Skip to content
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

fix: Don't consider := * to be definite assignment for non-ghost variables of a (00) type #5024

Merged
merged 5 commits into from
Jan 30, 2024

Conversation

RustanLeino
Copy link
Collaborator

Fixes #5023

Description

Previously, the verifier allowed := * to satisfy the definite-assignment obligation for any known-to-be-nonempty type, regardless of context. The fix is to use (0), not (00), for non-ghost assignments.

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

@keyboardDrummer
Copy link
Member

Repeating my comment on the issue:

Can you elaborate on the meaning of x := * ? If the meaning is "assign any value that satisfies this type", then wouldn't the above be a code generator bug, where the code generator should have either said no non-ghost witness found for assigning to subset type or generated x := 5 ?

@keyboardDrummer keyboardDrummer merged commit a5fd6f3 into dafny-lang:master Jan 30, 2024
20 checks passed
@RustanLeino RustanLeino deleted the issue-5023 branch January 30, 2024 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Definite-assignment checks too lenient
2 participants