diff options
author | Rustan Leino <leino@microsoft.com> | 2011-04-19 16:48:32 -0700 |
---|---|---|
committer | Rustan Leino <leino@microsoft.com> | 2011-04-19 16:48:32 -0700 |
commit | a0ccbb8461b68eb4a61ba78e0efced94423e93c7 (patch) | |
tree | 41bd0df0cf2afbb78c7cd7f500840397fe332269 /Test/dafny0/TypeTests.dfy | |
parent | 9313173a5462dd6bf0ac386c6ac129d6284e9f4d (diff) |
Dafny: added type "nat"
Diffstat (limited to 'Test/dafny0/TypeTests.dfy')
-rw-r--r-- | Test/dafny0/TypeTests.dfy | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Test/dafny0/TypeTests.dfy b/Test/dafny0/TypeTests.dfy index 93c4aec4..792c8fac 100644 --- a/Test/dafny0/TypeTests.dfy +++ b/Test/dafny0/TypeTests.dfy @@ -89,3 +89,12 @@ method ArrayRangeAssignments(a: array<C>) a[0..5] := new C; // this is not allowed
havoc a[1..4]; // this is not allowed
}
+
+// --------------------- tests of restrictions on subranges (nat)
+
+method K(s: set<nat>) { // error: not allowed to instantiate 'set' with 'nat'
+ var d: MutuallyRecursiveDataType<nat>; // error: not allowed to instantiate with 'nat'
+ var a := new nat[100]; // error: not allowed the type array<nat>
+ var b := new nat[100,200]; // error: not allowed the type array2<nat>
+}
+
|