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.
Don't say "error is impossible" anymore (dafny-lang#4292)
This was a confusing message and it's possible to do better. This addresses dafny-lang#3954, but I don't think it entirely resolves it. To do that, I think it'd be best to extend ProofObligationDescription to include related locations, which will require Boogie changes. This change helps the situation in the meantime, however. By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.
- Loading branch information
Showing
3 changed files
with
21 additions
and
10 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,13 @@ | ||
// RUN: %exits-with 4 %baredafny verify --show-snippets:false --log-format:text "%s" > "%t" | ||
// RUN: %OutputCheck --file-to-check "%t" "%s" | ||
// CHECK: Outcome: Invalid | ||
// CHECK: TripleDescription.dfy(.*,.*): this postcondition holds | ||
method BadAbs(x: int) returns (r: int) | ||
ensures r > 0 | ||
{ | ||
if(x < 0) { | ||
return -x; | ||
} else { | ||
return x; | ||
} | ||
} |