summaryrefslogtreecommitdiff
path: root/Test/dafny0/ResolutionErrors.dfy
diff options
context:
space:
mode:
authorGravatar leino <unknown>2015-03-13 02:23:38 -0700
committerGravatar leino <unknown>2015-03-13 02:23:38 -0700
commit0b7c479b76c4ebc8ae3cba0cbe0a7cbb0a19144a (patch)
treed05d82d1331911e78296bb9a72bdf4ae1d77b02d /Test/dafny0/ResolutionErrors.dfy
parent20c1f23d81579488e5b11a21d9353d10f15a1347 (diff)
Allow let-such-that expression to be compiled, provided that they provably have a unique value
Diffstat (limited to 'Test/dafny0/ResolutionErrors.dfy')
-rw-r--r--Test/dafny0/ResolutionErrors.dfy8
1 files changed, 4 insertions, 4 deletions
diff --git a/Test/dafny0/ResolutionErrors.dfy b/Test/dafny0/ResolutionErrors.dfy
index 78288b1e..f0138c6c 100644
--- a/Test/dafny0/ResolutionErrors.dfy
+++ b/Test/dafny0/ResolutionErrors.dfy
@@ -541,11 +541,11 @@ module NoTypeArgs1 {
method LetSuchThat(ghost z: int, n: nat)
{
var x: int;
- x := var y :| y < 0; y; // error: let-such-that not allowed in non-ghost context
+ x := var y :| y < 0; y; // fine for the resolver (but would give a verification error for not being deterministic)
- x := var y :| y < z; y; // error (x2): contraint depend on ghost, and let-such-that not allowed in non-ghost context
+ x := var y :| y < z; y; // error: contraint depend on ghost (z)
- x := var w :| w == 2*w; w; // error: let-such-that not allowed in non-ghost context
+ x := var w :| w == 2*w; w; // fine (even for the verifier, this one)
x := var w := 2*w; w; // error: the 'w' in the RHS of the assignment is not in scope
ghost var xg := var w :| w == 2*w; w;
}
@@ -1339,6 +1339,6 @@ module GhostLet {
x := ghost var tmp := 5; tmp; // error: ghost -> non-ghost
x := ghost var tmp := 5; 10; // fine
x := ghost var a0, a1 :| a0 == 0 && a1 == 1; a0 + a1; // error: ghost -> non-ghost
- x := ghost var a :| true; 10; // error: (conservatively) considered ghost -> non-ghost
+ x := ghost var a :| 0 <= a; 10; // fine
}
}