forked from dafny-lang/dafny
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Check well-definedness of forall-ensures
Fixes dafny-lang#2605
- Loading branch information
1 parent
6ea3725
commit 2dae005
Showing
4 changed files
with
29 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// RUN: %dafny_0 /compile:0 "%s" > "%t" | ||
// RUN: %diff "%s.expect" "%t" | ||
|
||
method M(a: array<int>, j: int) { | ||
forall n | 0 <= n < 100 | ||
ensures n / 0 == n / 0 // error (x2): division by zero | ||
ensures a[j] == a[j] // error (x2): array index out of bounds | ||
{ | ||
assert false; // error | ||
} | ||
assert false; // error | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
git-issue-2605.dfy(6,14): Error: possible division by zero | ||
git-issue-2605.dfy(6,23): Error: possible division by zero | ||
git-issue-2605.dfy(7,13): Error: index out of range | ||
git-issue-2605.dfy(7,21): Error: index out of range | ||
git-issue-2605.dfy(9,11): Error: assertion might not hold | ||
|
||
Dafny program verifier finished with 0 verified, 5 errors |