summaryrefslogtreecommitdiff
path: root/Test/dafny0/TypeTests.dfy
diff options
context:
space:
mode:
authorGravatar Rustan Leino <leino@microsoft.com>2011-10-26 20:55:53 -0700
committerGravatar Rustan Leino <leino@microsoft.com>2011-10-26 20:55:53 -0700
commit2b1732bf84b88b5656a305b781fdb818e5738ea6 (patch)
tree6ac9acb21b8276d9220c7d0c714375973754ef23 /Test/dafny0/TypeTests.dfy
parent736bffc734c9c5d0245d6c483647b43add1ce13a (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.dfy11
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)