diff options
author | Rustan Leino <unknown> | 2015-07-31 16:58:36 -0700 |
---|---|---|
committer | Rustan Leino <unknown> | 2015-07-31 16:58:36 -0700 |
commit | d023b0e19f7bf886801a3a059511b8449d8ab223 (patch) | |
tree | 1517417d51d4ef5d3190f13ff6b3dc7b82347429 /Test/dafny0/ResolutionErrors.dfy | |
parent | 8c1a52e085aed20f62a5d24fb2af9bbd5cb3e469 (diff) |
Bug fix: check that assign-such-that constraint is of type boolean
Diffstat (limited to 'Test/dafny0/ResolutionErrors.dfy')
-rw-r--r-- | Test/dafny0/ResolutionErrors.dfy | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Test/dafny0/ResolutionErrors.dfy b/Test/dafny0/ResolutionErrors.dfy index 900c7459..1354e533 100644 --- a/Test/dafny0/ResolutionErrors.dfy +++ b/Test/dafny0/ResolutionErrors.dfy @@ -1373,3 +1373,18 @@ module NonTypeVariableNames { Y := k; // error: module name used as variable
}
}
+
+// ------------------- assign-such-that and let-such-that -------------------
+
+module SuchThat {
+ method M() {
+ var x: int;
+ x :| 5 + 7; // error: constraint should be boolean
+ x :| x; // error: constraint should be boolean
+ var y :| 4; // error: constraint should be boolean
+ }
+ function F(): int {
+ var w :| 6 + 8; // error: constraint should be boolean
+ w
+ }
+}
|