Repository navigation
fix: Check for correct use of type characteristics in ghosts and default expressions - #4928
Merged
Merged
Conversation
…ault expressions Fixes dafny-lang#4926
keyboardDrummer
previously approved these changes
Jan 3, 2024
RustanLeino
enabled auto-merge (squash)
January 9, 2024 17:48
# Conflicts: # Source/DafnyStandardLibraries/binaries/DafnyStandardLibraries-cs.doo # Source/DafnyStandardLibraries/binaries/DafnyStandardLibraries-go.doo # Source/DafnyStandardLibraries/binaries/DafnyStandardLibraries-java.doo # Source/DafnyStandardLibraries/binaries/DafnyStandardLibraries-js.doo # Source/DafnyStandardLibraries/binaries/DafnyStandardLibraries-notarget.doo # Source/DafnyStandardLibraries/binaries/DafnyStandardLibraries-py.doo # Source/DafnyStandardLibraries/binaries/DafnyStandardLibraries.doo # Source/DafnyStandardLibraries/src/Std/Collections/Seq.dfy
keyboardDrummer
approved these changes
Jan 22, 2024
| @@ -0,0 +1 @@ | |||
| Check for correct usage of type characteristics in specifications and other places where they were missing | |||
Member
There was a problem hiding this comment.
If I understand correctly then this PR is a breaking change: it will cause Dafny to error in some locations where it previously did not. For example you had to update Source/DafnyStandardLibraries/src/Std/Collections/Array.dfy Might be good to note that in the release notes.
keyboardDrummer
approved these changes
Jan 22, 2024
RustanLeino
added a commit
that referenced
this pull request
Jan 27, 2024
Embellish release notes of PR #4928. The release note now try to make it clear that any new errors (for this issue) on previous programs are intentional. <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>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR adds checks for correct instantiations of type parameters that were previously missing. Previously, these checks were only done in non-ghost expressions (historically, it seems the code that performs these checks was designed for checking
(==), which applies only in ghost expressions). This PR adds the checks also specifications (which are ghost) and default expressions for parameters).The new test file
git-issue-4926.dfyreports 38 errors, whereas before this PR, Dafny reported only 8.It also extracts the code for these checks into a separate file,
TypeCharacteristicChecker.cs(in addition to the existing fileCheckTypeCharacteristics_Visitor).Fixes #4926
By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.