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 reveal statement inside witness bug #5887

Merged
merged 4 commits into from
Nov 1, 2024

Conversation

keyboardDrummer
Copy link
Member

Fixes #5882

How has this been tested?

CLI test added

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

Copy link
Member

@MikaelMayer MikaelMayer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two suggestions

@@ -15,15 +14,15 @@ method RevealExpressionScope()
{
hide *;
var a := (reveal P; assert P(0); true);
assert P(1); // error
assert P(1); // no error, expression leaks.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope one day it will be clear enough why it leaks, or it will be the default that it does not leak unless the reveal itself is marked explicitly as leaking.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still hoping the remove the need for expression statements, but we'll see whether that's possible and desired.

@@ -0,0 +1 @@
Enable using reveal statement expression inside witness expressions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Enable using reveal statement expression inside witness expressions
Enable using reveal statement expression inside witness expressions when the new resolver is activated with `--type-system-refresh`

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed this limitation in a previous PR

@keyboardDrummer keyboardDrummer merged commit 28ab6fb into dafny-lang:master Nov 1, 2024
22 checks passed
@keyboardDrummer keyboardDrummer deleted the revealWitnessBug branch November 1, 2024 17:20
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.

Internal error when reavealing in subset type witness clause
2 participants