diff options
author | Rustan Leino <leino@microsoft.com> | 2011-10-26 20:55:53 -0700 |
---|---|---|
committer | Rustan Leino <leino@microsoft.com> | 2011-10-26 20:55:53 -0700 |
commit | 2b1732bf84b88b5656a305b781fdb818e5738ea6 (patch) | |
tree | 6ac9acb21b8276d9220c7d0c714375973754ef23 /Test/dafny0/TypeTests.dfy | |
parent | 736bffc734c9c5d0245d6c483647b43add1ce13a (diff) |
Dafny: removed support for assigning to an array-range (that is, an assignment statement where the LHS has the form a[lo..hi])
Diffstat (limited to 'Test/dafny0/TypeTests.dfy')
-rw-r--r-- | Test/dafny0/TypeTests.dfy | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Test/dafny0/TypeTests.dfy b/Test/dafny0/TypeTests.dfy index 2208051d..29274381 100644 --- a/Test/dafny0/TypeTests.dfy +++ b/Test/dafny0/TypeTests.dfy @@ -72,11 +72,16 @@ method InitCalls() { // ---------------------
-method ArrayRangeAssignments(a: array<C>)
+method ArrayRangeAssignments(a: array<C>, c: C)
requires a != null && 10 <= a.Length;
{
- a[0..5] := new C; // this is not allowed
- a[1..4] := *; // this is not allowed
+ a[0..5] := new C; // error: this is not allowed
+ a[1..4] := *; // error: this is not allowed
+ a[2..3] := c; // error: this is not allowed
+ var s: seq<C> := [null,null,null,null,null];
+ s[0..5] := new C; // error: this is not allowed
+ s[1..4] := *; // error: this is not allowed
+ s[2..3] := c; // error: this is not allowed
}
// --------------------- tests of restrictions on subranges (nat)
|