summaryrefslogtreecommitdiff
path: root/Dafny/Compiler.cs
diff options
context:
space:
mode:
authorGravatar Rustan Leino <leino@microsoft.com>2012-02-16 13:19:29 -0800
committerGravatar Rustan Leino <leino@microsoft.com>2012-02-16 13:19:29 -0800
commit2d672bd83995d33c2adca085ea4cdbef351ab29f (patch)
tree70bde50ea1ca3554196dfd308c3dd9f53915c4c3 /Dafny/Compiler.cs
parentd55fc9dd21b1de421034d89dffc2fb38c14b8d51 (diff)
Dafny: fixed a couple of compiler bugs
Diffstat (limited to 'Dafny/Compiler.cs')
-rw-r--r--Dafny/Compiler.cs8
1 files changed, 6 insertions, 2 deletions
diff --git a/Dafny/Compiler.cs b/Dafny/Compiler.cs
index caf3df24..a1f9e4fc 100644
--- a/Dafny/Compiler.cs
+++ b/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));
}