diff options
author | Rustan Leino <leino@microsoft.com> | 2012-02-16 13:19:29 -0800 |
---|---|---|
committer | Rustan Leino <leino@microsoft.com> | 2012-02-16 13:19:29 -0800 |
commit | 042d44edc9d74c779638810be7cb6d54a5a5b2a1 (patch) | |
tree | 3cf40468c1c76a045f55c3f8a749e1ae8cd0b42b /Source/Dafny | |
parent | efaf4ec02bd41e9c291b8199179eafb5dbea2fee (diff) |
Dafny: fixed a couple of compiler bugs
Diffstat (limited to 'Source/Dafny')
-rw-r--r-- | Source/Dafny/Compiler.cs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Source/Dafny/Compiler.cs b/Source/Dafny/Compiler.cs index caf3df24..a1f9e4fc 100644 --- a/Source/Dafny/Compiler.cs +++ b/Source/Dafny/Compiler.cs @@ -1216,7 +1216,7 @@ namespace Microsoft.Dafny { } else {
if (rhs is ExprRhs) {
SpillLetVariableDecls(((ExprRhs)rhs).Expr, indent);
- } else if (tRhs != null) {
+ } else if (tRhs != null && tRhs.ArrayDimensions != null) {
foreach (Expression dim in tRhs.ArrayDimensions) {
SpillLetVariableDecls(dim, indent);
}
@@ -1582,7 +1582,11 @@ namespace Microsoft.Dafny { } else if (expr is DatatypeValue) {
DatatypeValue dtv = (DatatypeValue)expr;
Contract.Assert(dtv.Ctor != null); // since dtv has been successfully resolved
- wr.Write("new {0}(new {1}", dtv.DatatypeName, DtCtorName(dtv.Ctor));
+ wr.Write("new {0}", dtv.DatatypeName);
+ if (dtv.InferredTypeArgs.Count != 0) {
+ wr.Write("<{0}>", TypeNames(dtv.InferredTypeArgs));
+ }
+ wr.Write("(new {0}", DtCtorName(dtv.Ctor));
if (dtv.InferredTypeArgs.Count != 0) {
wr.Write("<{0}>", TypeNames(dtv.InferredTypeArgs));
}
|