diff --git a/Source/Dafny/Resolver.cs b/Source/Dafny/Resolver.cs index 504631395e0..176c88b87dc 100644 --- a/Source/Dafny/Resolver.cs +++ b/Source/Dafny/Resolver.cs @@ -11958,7 +11958,7 @@ public RBranchStmt(IToken tok, int branchid, List patterns, Lis public RBranchStmt(int branchid, NestedMatchCaseStmt x, Attributes attrs = null) : base(x.Tok, branchid, new List()) { Contract.Requires(!(x.Pat is DisjunctivePattern)); // No nested or patterns - this.Body = new List(x.Body); // Resolving the body will insert new elements. + this.Body = new List(x.Body); // Resolving the body will insert new elements. this.Attributes = attrs; this.Patterns.Add(x.Pat); } @@ -12527,14 +12527,14 @@ private IEnumerable FlattenDisjunctivePatterns(ExtendedPattern private IEnumerable FlattenNestedMatchCaseExpr(NestedMatchCaseExpr c) { var cloner = new Cloner(); foreach (var pat in FlattenDisjunctivePatterns(c.Pat)) { - yield return new NestedMatchCaseExpr(c.Tok, pat, cloner.CloneExpr(c.Body), cloner.CloneAttributes(c.Attributes)); + yield return new NestedMatchCaseExpr(c.Tok, pat, c.Body, c.Attributes); } } private IEnumerable FlattenNestedMatchCaseStmt(NestedMatchCaseStmt c) { var cloner = new Cloner(); foreach (var pat in FlattenDisjunctivePatterns(c.Pat)) { - yield return new NestedMatchCaseStmt(c.Tok, pat, c.Body.ConvertAll(cloner.CloneStmt), cloner.CloneAttributes(c.Attributes)); + yield return new NestedMatchCaseStmt(c.Tok, pat, new List(c.Body), c.Attributes); } }