summaryrefslogtreecommitdiff
path: root/Test
diff options
context:
space:
mode:
authorGravatar Rustan Leino <unknown>2016-03-01 15:38:18 -0800
committerGravatar Rustan Leino <unknown>2016-03-01 15:38:18 -0800
commit2144154dc66b8d83792dd4395d3059c97d044e01 (patch)
tree2b6a64475391309a24fecf839c77379b06fea023 /Test
parent1f38d2d252aaac3d55191e6c3dad46ecffdfee2c (diff)
parent45e7bb72d4a8676796cb71cd8d11787dd6f91e17 (diff)
Merge
Diffstat (limited to 'Test')
-rw-r--r--Test/dafny4/Bug139.dfy25
-rw-r--r--Test/dafny4/Bug139.dfy.expect2
2 files changed, 27 insertions, 0 deletions
diff --git a/Test/dafny4/Bug139.dfy b/Test/dafny4/Bug139.dfy
new file mode 100644
index 00000000..bd4ded73
--- /dev/null
+++ b/Test/dafny4/Bug139.dfy
@@ -0,0 +1,25 @@
+// RUN: %dafny /compile:0 "%s" > "%t"
+// RUN: %diff "%s.expect" "%t"
+
+datatype List = Nil | Cons(int, List)
+
+method R(xs: List)
+{
+ var a: int;
+ var b: int;
+ match xs
+ case Nil =>
+ case Cons(a, Nil()) => // this 'a' is allowed
+ case Cons(x, Cons(b, tail)) => // this 'b' (which is in a nested position) generates an error
+}
+
+function F(xs: List): int
+{
+ var a := 4;
+ var b := 7;
+ match xs
+ case Nil => 0
+ case Cons(a, Nil()) => 1
+ case Cons(x, Cons(b, tail)) => 2
+}
+
diff --git a/Test/dafny4/Bug139.dfy.expect b/Test/dafny4/Bug139.dfy.expect
new file mode 100644
index 00000000..52595bf9
--- /dev/null
+++ b/Test/dafny4/Bug139.dfy.expect
@@ -0,0 +1,2 @@
+
+Dafny program verifier finished with 3 verified, 0 errors