summaryrefslogtreecommitdiff
path: root/Test/dafny0/ResolutionErrors.dfy
diff options
context:
space:
mode:
authorGravatar Rustan Leino <unknown>2015-07-31 16:58:36 -0700
committerGravatar Rustan Leino <unknown>2015-07-31 16:58:36 -0700
commitd023b0e19f7bf886801a3a059511b8449d8ab223 (patch)
tree1517417d51d4ef5d3190f13ff6b3dc7b82347429 /Test/dafny0/ResolutionErrors.dfy
parent8c1a52e085aed20f62a5d24fb2af9bbd5cb3e469 (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.dfy15
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
+ }
+}