summaryrefslogtreecommitdiff
path: root/Source/Dafny/Cloner.cs
diff options
context:
space:
mode:
authorGravatar qunyanm <unknown>2015-06-19 16:10:25 -0700
committerGravatar qunyanm <unknown>2015-06-19 16:10:25 -0700
commit0e2d86cd4fdfe917df8a6f755f4cccd66f2c16e2 (patch)
tree0532017a5223817ee112da56659add30bb680e7c /Source/Dafny/Cloner.cs
parente1326254214bcd2546ab5ca992cf4c26e4aa99ed (diff)
Fix various bugs in nested match patterns listed in issue #83
Diffstat (limited to 'Source/Dafny/Cloner.cs')
-rw-r--r--Source/Dafny/Cloner.cs8
1 files changed, 6 insertions, 2 deletions
diff --git a/Source/Dafny/Cloner.cs b/Source/Dafny/Cloner.cs
index 9b7bb12e..f13aa2f4 100644
--- a/Source/Dafny/Cloner.cs
+++ b/Source/Dafny/Cloner.cs
@@ -294,8 +294,7 @@ namespace Microsoft.Dafny
return new MapDisplayExpr(Tok(expr.tok), e.Finite, pp);
} else if (expr is NameSegment) {
- var e = (NameSegment)expr;
- return new NameSegment(Tok(e.tok), e.Name, e.OptTypeArguments == null ? null : e.OptTypeArguments.ConvertAll(CloneType));
+ return CloneNameSegment(expr);
} else if (expr is ExprDotName) {
var e = (ExprDotName)expr;
return new ExprDotName(Tok(e.tok), CloneExpr(e.Lhs), e.SuffixName, e.OptTypeArguments == null ? null : e.OptTypeArguments.ConvertAll(CloneType));
@@ -449,6 +448,11 @@ namespace Microsoft.Dafny
}
}
+ public virtual NameSegment CloneNameSegment(Expression expr) {
+ var e = (NameSegment)expr;
+ return new NameSegment(Tok(e.tok), e.Name, e.OptTypeArguments == null ? null : e.OptTypeArguments.ConvertAll(CloneType));
+ }
+
public virtual AssignmentRhs CloneRHS(AssignmentRhs rhs) {
AssignmentRhs c;
if (rhs is ExprRhs) {