diff options
author | Rustan Leino <leino@microsoft.com> | 2011-05-26 18:03:06 -0700 |
---|---|---|
committer | Rustan Leino <leino@microsoft.com> | 2011-05-26 18:03:06 -0700 |
commit | 3e31a8d7c1445748450c258a50160c37e112a702 (patch) | |
tree | 400ef7259175adaa6587687556405ec733579072 /Test/dafny0/SmallTests.dfy | |
parent | 8d353c7dca06d1121a3751efbb4a85721d81b2dd (diff) |
Dafny: fixed bug (ill-formed Boogie) in translation of "foreach" for sequences
Diffstat (limited to 'Test/dafny0/SmallTests.dfy')
-rw-r--r-- | Test/dafny0/SmallTests.dfy | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/Test/dafny0/SmallTests.dfy b/Test/dafny0/SmallTests.dfy index a5f02dc6..7cbabcd7 100644 --- a/Test/dafny0/SmallTests.dfy +++ b/Test/dafny0/SmallTests.dfy @@ -309,7 +309,7 @@ method QuantifierRange2<T>(a: seq<T>, x: T, y: T, N: int) }
}
-// ----------------------- tests that involve sequences of boxed booleans --------
+// ----------------------- tests that involve sequences of boxes --------
ghost method M(zeros: seq<bool>, Z: bool)
requires 1 <= |zeros| && Z == false;
@@ -318,3 +318,16 @@ ghost method M(zeros: seq<bool>, Z: bool) var x := [Z];
assert zeros[0..1] == [Z];
}
+
+class SomeType
+{
+ var x: int;
+ method DoIt(stack: seq<SomeType>)
+ modifies stack;
+ {
+ // the following line once gave rise to a crash in the translation
+ foreach (n in stack) {
+ n.x := 10;
+ }
+ }
+}
|