Repository navigation
Fix issue #841 #919
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jcp19
wants to merge
19
commits into
master
Choose a base branch
from
fix-841
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Fix issue #841 #919
Changes from 6 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
035413f
Revert "Revert commits accidentally pushed to master"
jcp19 4db912e
add missing termination measures
jcp19 fa08b49
add more termination measures to stdlib packages
jcp19 18dabab
merge with master
jcp19 06f6a04
Merge branch 'master' into fix-841
jcp19 83074a8
Restrict issue #841 regression test to always-checked rules; fix embe…
jcp19 d1bda4f
Add unit tests for the termination-measure requirement on pure interf…
jcp19 e14daf0
Check pure-member termination measures uniformly in wellDefIfPureSpec
jcp19 dc554ec
Fix parse error in 000841 regression test
jcp19 e7188ad
Merge branch 'master' into fix-841
jcp19 02e7cdd
Test that pure interface methods must have termination measures
jcp19 29b75ae
Require termination measures for ghost interface methods
jcp19 7d7b73f
Check interface method signatures in a single place
jcp19 bfbf3fa
Check pure closure literals like all other pure members
jcp19 2eda1d1
Document why the termination checks need their own test suite
jcp19 844fa54
Update src/main/scala/viper/gobra/frontend/info/implementation/typing…
jcp19 467f4fb
Update src/main/scala/viper/gobra/frontend/info/implementation/typing…
jcp19 ae62d80
Update src/main/scala/viper/gobra/frontend/ParseTreeTranslator.scala
jcp19 309fbb1
Update src/test/resources/regressions/features/opaque/opaque-closure-…
jcp19 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,39 @@ | ||
| // Any copyright is dedicated to the Public Domain. | ||
| // http://creativecommons.org/publicdomain/zero/1.0/ | ||
|
|
||
| package issue000841 | ||
|
|
||
| // Issue #841: pure method signatures in an interface must satisfy the same | ||
| // requirements as pure implementations. Requiring a termination measure is | ||
| // gated behind the same flag as for pure functions and methods | ||
| // (`disableCheckTerminationPureFns`), which the regression test suite disables; | ||
| // hence this file exercises the requirements that are always checked: exactly | ||
| // one result parameter, non-variadic parameters, and the rejection of | ||
| // conditional termination measures. | ||
|
|
||
| type J interface { | ||
| // Type error, a pure interface method must have exactly one result parameter. | ||
| // The error is reported at the start of the method specification. | ||
| //:: ExpectedOutput(type_error) | ||
| decreases | ||
| pure | ||
| M1(a int) | ||
|
jcp19 marked this conversation as resolved.
Outdated
|
||
|
|
||
| // Type error, we do not permit conditional termination measures for members that must terminate. | ||
| //:: ExpectedOutput(type_error) | ||
| decreases if a == 42 | ||
| pure | ||
| M2(a int) int | ||
|
jcp19 marked this conversation as resolved.
Outdated
|
||
|
|
||
| // Type error, a pure interface method cannot have variadic parameters. | ||
| decreases | ||
| pure | ||
| //:: ExpectedOutput(type_error) | ||
| M3(a ...int) int | ||
|
jcp19 marked this conversation as resolved.
Outdated
|
||
| } | ||
|
|
||
| // Conditional termination measures are likewise rejected for top-level pure functions. | ||
| pure | ||
| //:: ExpectedOutput(type_error) | ||
| decreases _ if b // we syntactically disallow conditional termination measures for members that must terminate | ||
| func f(b bool) bool | ||
|
jcp19 marked this conversation as resolved.
Outdated
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.