-
Notifications
You must be signed in to change notification settings - Fork 259
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat:
{:only}
attribute for members (#4075)
This PR implements a feature that fixes #4074 I added the corresponding tests, auditor entries and documentations with appropriate links. <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> --------- Co-authored-by: Aaron Tomb <aarotomb@amazon.com>
- Loading branch information
1 parent
b03a067
commit 1517136
Showing
21 changed files
with
211 additions
and
49 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -137,3 +137,7 @@ method AssertOnly() { | |
assert {:only} true; | ||
assert false; | ||
} | ||
|
||
method {:only} MethodOnly() { | ||
assert false; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// RUN: %exits-with 4 %baredafny verify %args "%s" > "%t" | ||
// RUN: %diff "%s.expect" "%t" | ||
|
||
method {:only "wrongArgument"} TestReported() { | ||
assert false; // An error here | ||
} | ||
|
||
method TestNotReported() { | ||
assert false; | ||
} | ||
|
||
class A { | ||
method {:only} TestReported() { | ||
assert false; // An error here | ||
} | ||
|
||
method TestNotReported() { | ||
assert false; | ||
} | ||
} | ||
|
||
module B { | ||
method {:only} TestReported() { | ||
assert false; // An error here | ||
} | ||
|
||
method TestNotReported() { | ||
assert false; | ||
} | ||
} |
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,9 @@ | ||
git-issue-4074.dfy(23,9): Warning: Members with {:only} temporarily disable the verification of other members in the entire file | ||
git-issue-4074.dfy(13,9): Warning: Members with {:only} temporarily disable the verification of other members in the entire file | ||
git-issue-4074.dfy(4,7): Warning: Members with {:only} temporarily disable the verification of other members in the entire file | ||
git-issue-4074.dfy(4,14): Warning: {:only} on members does not support arguments | ||
git-issue-4074.dfy(24,11): Error: assertion might not hold | ||
git-issue-4074.dfy(14,11): Error: assertion might not hold | ||
git-issue-4074.dfy(5,9): Error: assertion might not hold | ||
|
||
Dafny program verifier finished with 0 verified, 3 errors |
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.