diff options
author | Rustan Leino <leino@microsoft.com> | 2012-01-26 13:05:50 -0800 |
---|---|---|
committer | Rustan Leino <leino@microsoft.com> | 2012-01-26 13:05:50 -0800 |
commit | 4888eb23bb6ccd0900915ee00d9fcbc25c2f21e1 (patch) | |
tree | cea1ae346321712532a8ff68c6b7765ffa6eb894 /Dafny | |
parent | 84044e50d78c3fb1bddb6a72ab39bce7cc6caa55 (diff) |
Dafny: fixed bug in compilation of let expressions.
Diffstat (limited to 'Dafny')
-rw-r--r-- | Dafny/Compiler.cs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Dafny/Compiler.cs b/Dafny/Compiler.cs index 4a2b41a1..caf3df24 100644 --- a/Dafny/Compiler.cs +++ b/Dafny/Compiler.cs @@ -545,16 +545,17 @@ namespace Microsoft.Dafny { Contract.Requires(0 <= indent);
if (expr == null) {
// allow "null" as an argument; nothing to do
- } else if (expr is LetExpr) {
+ return;
+ }
+ if (expr is LetExpr) {
var e = (LetExpr)expr;
foreach (var v in e.Vars) {
Indent(indent);
wr.WriteLine("{0} @{1};", TypeName(v.Type), v.Name);
}
- } else {
- foreach (var ee in expr.SubExpressions) {
- SpillLetVariableDecls(ee, indent);
- }
+ }
+ foreach (var ee in expr.SubExpressions) {
+ SpillLetVariableDecls(ee, indent);
}
}
|