-
Notifications
You must be signed in to change notification settings - Fork 267
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve error message locations for function calls and call arguments (…
…#6009) ### What was changed? Added a method for updating test expect files based on CI output. This is contained in the C# project `Scripts` #### Call arguments Errors that relate to call arguments are reported on the argument, instead of on the `(`. Example: ```dafny r := new C<char>.Orig('h'); // error incorrect argument type for constructor // in-parameter 'x' (expected X, found char) ^ new location ^ old location ``` #### Function calls Errors that relate to function or method calls are now consistently reported on the `(`. This was already done for method calls, while for function calls the error was reported on the center of the callee expression. It's better to report on the `(`, to distinguish from errors in computing the callee, which are reported on the center of the callee expression. Example: ```dafny ghost const objs: set<object> := getObjs() ^ new location ^ old location // Error: insufficient reads clause to invoke function ``` #### Assertions Currently, errors about assertions (assert/ensure/invariant) are reported on the center of the condition. Since this PR changes the center of expressions that call functions, the locations for 'assertion might not hold' can change as well. Example: ```dafny assert !Even(N(17)); ^^^^|^^^^^^ new origin |^^^ previous origin // Error: assertion might not hold ``` Another example: ```dafny ensures Pos(UpIList(n)) ^ new location ^ old location // Related location: this is the postcondition that could not be proved ``` ### How has this been tested? - Updated existing tests <small>By submitting this pull request, I confirm that my contribution is made under the terms of the [MIT license](https://github.com/dafny-lang/dafny/blob/master/LICENSE.txt).</small>
- Loading branch information
1 parent
c42b706
commit b8fad27
Showing
150 changed files
with
797 additions
and
688 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
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
2 changes: 1 addition & 1 deletion
2
...les/LitTests/LitTest/HigherOrderIntrinsicSpecification/ReadPreconditionBypass1.dfy.expect
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
ReadPreconditionBypass1.dfy(23,20): Error: function precondition could not be proved | ||
ReadPreconditionBypass1.dfy(23,25): Error: function precondition could not be proved | ||
|
||
Dafny program verifier finished with 1 verified, 1 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
2 changes: 1 addition & 1 deletion
2
...grationTests/TestFiles/LitTests/LitTest/autoRevealDependencies/func-depth-fail.dfy.expect
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
func-depth-fail.dfy(12,2): Error: a postcondition could not be proved on this return path | ||
func-depth-fail.dfy(12,3): Error: a postcondition could not be proved on this return path | ||
func-depth-fail.dfy(10,10): Related location: this is the postcondition that could not be proved | ||
|
||
Dafny program verifier finished with 3 verified, 1 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
22 changes: 11 additions & 11 deletions
22
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/AutoReq.dfy.expect
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 |
---|---|---|
@@ -1,21 +1,21 @@ | ||
AutoReq.dfy(13,2): Error: function precondition could not be proved | ||
AutoReq.dfy(13,3): Error: function precondition could not be proved | ||
AutoReq.dfy(5,13): Related location: this proposition could not be proved | ||
AutoReq.dfy(25,2): Error: function precondition could not be proved | ||
AutoReq.dfy(25,3): Error: function precondition could not be proved | ||
AutoReq.dfy(5,13): Related location: this proposition could not be proved | ||
AutoReq.dfy(38,11): Error: function precondition could not be proved | ||
AutoReq.dfy(38,12): Error: function precondition could not be proved | ||
AutoReq.dfy(5,13): Related location: this proposition could not be proved | ||
AutoReq.dfy(38,11): Error: assertion might not hold | ||
AutoReq.dfy(31,12): Related location: this proposition could not be proved | ||
AutoReq.dfy(38,12): Error: assertion might not hold | ||
AutoReq.dfy(31,13): Related location: this proposition could not be proved | ||
AutoReq.dfy(7,4): Related location: this proposition could not be proved | ||
AutoReq.dfy(40,11): Error: function precondition could not be proved | ||
AutoReq.dfy(40,12): Error: function precondition could not be proved | ||
AutoReq.dfy(5,13): Related location: this proposition could not be proved | ||
AutoReq.dfy(40,11): Error: assertion might not hold | ||
AutoReq.dfy(31,26): Related location: this proposition could not be proved | ||
AutoReq.dfy(40,12): Error: assertion might not hold | ||
AutoReq.dfy(31,27): Related location: this proposition could not be proved | ||
AutoReq.dfy(7,4): Related location: this proposition could not be proved | ||
AutoReq.dfy(45,11): Error: assertion might not hold | ||
AutoReq.dfy(31,12): Related location: this proposition could not be proved | ||
AutoReq.dfy(45,12): Error: assertion might not hold | ||
AutoReq.dfy(31,13): Related location: this proposition could not be proved | ||
AutoReq.dfy(7,4): Related location: this proposition could not be proved | ||
AutoReq.dfy(247,4): Error: function precondition could not be proved | ||
AutoReq.dfy(247,6): Error: function precondition could not be proved | ||
AutoReq.dfy(239,13): Related location: this proposition could not be proved | ||
|
||
Dafny program verifier finished with 30 verified, 8 errors |
2 changes: 1 addition & 1 deletion
2
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Backticks.dfy.expect
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Backticks.dfy(38,4): Error: insufficient reads clause to invoke function | ||
Backticks.dfy(38,5): Error: insufficient reads clause to invoke function | ||
Backticks.dfy(77,7): Error: call might violate context's modifies clause | ||
|
||
Dafny program verifier finished with 12 verified, 2 errors |
2 changes: 1 addition & 1 deletion
2
Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/BadFunction.dfy.expect
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
BadFunction.dfy(9,2): Error: decreases clause might not decrease | ||
BadFunction.dfy(9,3): Error: decreases clause might not decrease | ||
|
||
Dafny program verifier finished with 1 verified, 1 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
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
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
Oops, something went wrong.