diff options
author | qunyanm <unknown> | 2015-11-14 14:50:26 -0800 |
---|---|---|
committer | qunyanm <unknown> | 2015-11-14 14:50:26 -0800 |
commit | 854acf0f7f5aa105500c6d0ee0fcf0d4c918a81e (patch) | |
tree | 782088f9c132efca00ff8b042d4cf32f41bbf82d /Test | |
parent | cfd717411a1d82e4d0b1ad845cbe0984ecc1618f (diff) |
Fix issue 94. Allow tuple-based assignment in statement contexts.
Diffstat (limited to 'Test')
-rw-r--r-- | Test/dafny4/Bug94.dfy | 35 | ||||
-rw-r--r-- | Test/dafny4/Bug94.dfy.expect | 6 | ||||
-rw-r--r-- | Test/server/simple-session.transcript.expect | 2 |
3 files changed, 42 insertions, 1 deletions
diff --git a/Test/dafny4/Bug94.dfy b/Test/dafny4/Bug94.dfy new file mode 100644 index 00000000..2f437785 --- /dev/null +++ b/Test/dafny4/Bug94.dfy @@ -0,0 +1,35 @@ +// RUN: %dafny /compile:3 "%s" > "%t"
+// RUN: %diff "%s.expect" "%t"
+
+function foo() : (int, int)
+{
+ (5, 10)
+}
+
+function bar() : int
+{
+ var (x, y) := foo();
+ x + y
+}
+
+lemma test()
+{
+ var (x, y) := foo();
+}
+
+function method foo2() : (int,int)
+{
+ (5, 10)
+}
+
+method test2()
+{
+ var (x, y) := foo2();
+}
+
+method Main()
+{
+ var (x, y) := foo2();
+ assert (x+y == 15);
+ print(x+y);
+}
diff --git a/Test/dafny4/Bug94.dfy.expect b/Test/dafny4/Bug94.dfy.expect new file mode 100644 index 00000000..6b337d5a --- /dev/null +++ b/Test/dafny4/Bug94.dfy.expect @@ -0,0 +1,6 @@ +
+Dafny program verifier finished with 9 verified, 0 errors
+Program compiled successfully
+Running...
+
+15
\ No newline at end of file diff --git a/Test/server/simple-session.transcript.expect b/Test/server/simple-session.transcript.expect index 91429d8e..1aadca7f 100644 --- a/Test/server/simple-session.transcript.expect +++ b/Test/server/simple-session.transcript.expect @@ -136,7 +136,7 @@ Retrieving cached verification result for implementation Impl$$_module.__default [0 proof obligations] verified
Verification completed successfully! [SUCCESS] [[DAFNY-SERVER: EOM]] -transcript(7,0): Error: ident expected
+transcript(7,0): Error: invalid VarDeclStatement
Verification completed successfully! [SUCCESS] [[DAFNY-SERVER: EOM]] |