From 26baa7644418ff146b18dfb4cfd72b484a43ea98 Mon Sep 17 00:00:00 2001 From: sboehme Date: Fri, 27 Aug 2010 23:03:39 +0000 Subject: Dafny: fallback to ShallowType (elements of IndexField arrays seem to have Type null) --- Dafny/Translator.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dafny/Translator.cs b/Dafny/Translator.cs index bdb436ce..cd084ca1 100644 --- a/Dafny/Translator.cs +++ b/Dafny/Translator.cs @@ -3946,8 +3946,9 @@ Contract.Requires(tok != null); args.Add(heap); args.Add(r); args.Add(f); + Bpl.Type t = (f.Type != null) ? f.Type : f.ShallowType; return new Bpl.NAryExpr(tok, - new Bpl.FunctionCall(new Bpl.IdentifierExpr(tok, "read", f.Type.AsCtor.Arguments[0])), + new Bpl.FunctionCall(new Bpl.IdentifierExpr(tok, "read", t.AsCtor.Arguments[0])), args); } -- cgit v1.2.3