From f011e32f5a4a62b241c0c1301ab8010878b1bc7b Mon Sep 17 00:00:00 2001 From: qunyanm Date: Mon, 30 Nov 2015 13:03:21 -0800 Subject: Fix issue 111. Create a new BoundVar for each CasePattern of MatchCaseExpr when trying to substitute the nested CasePattern with the BoundVar. --- Test/dafny4/Bug111.dfy | 18 ++++++++++++++++++ Test/dafny4/Bug111.dfy.expect | 2 ++ 2 files changed, 20 insertions(+) create mode 100644 Test/dafny4/Bug111.dfy create mode 100644 Test/dafny4/Bug111.dfy.expect (limited to 'Test') diff --git a/Test/dafny4/Bug111.dfy b/Test/dafny4/Bug111.dfy new file mode 100644 index 00000000..730d44d3 --- /dev/null +++ b/Test/dafny4/Bug111.dfy @@ -0,0 +1,18 @@ +// RUN: %dafny /compile:0 "%s" > "%t" +// RUN: %diff "%s.expect" "%t" + +datatype A = A(i:int) +datatype B = B1(a1:A) | B2(a2:A) + +function f(b:B):int +{ + match b + { + case B1(A(i)) => i + case B2(A(j)) => j + } +} + + + + diff --git a/Test/dafny4/Bug111.dfy.expect b/Test/dafny4/Bug111.dfy.expect new file mode 100644 index 00000000..c0c48e2b --- /dev/null +++ b/Test/dafny4/Bug111.dfy.expect @@ -0,0 +1,2 @@ + +Dafny program verifier finished with 1 verified, 0 errors -- cgit v1.2.3