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: Handling of opaque methods in traits overriding check #4207

Merged

Conversation

MikaelMayer
Copy link
Member

This PR fixes #4205
I added the corresponding test.

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

@MikaelMayer MikaelMayer requested a review from atomb June 22, 2023 15:33
@MikaelMayer MikaelMayer enabled auto-merge (squash) July 5, 2023 21:07
Copy link
Member

@atomb atomb left a comment

Choose a reason for hiding this comment

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

I suggested a couple of tiny adjustments.

} else if (overridingFunction.IsOpaque) {
// We can't use a bound variable $fuel, because then one of the triggers won't be mentioning this $fuel.
// Instead, we do the next best thing: use the literal false.
reveal = new Boogie.IdentifierExpr(f.tok, "false", Boogie.Type.Bool);
Copy link
Member

Choose a reason for hiding this comment

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

Can you create a literal expression instead of an identifier expression here? I think this accidentally works but is confusing, since false is an actual value rather than a name for a value, at least in the semantics I understand.

@@ -0,0 +1 @@
Handling of opaque methods in traits overriding check
Copy link
Member

Choose a reason for hiding this comment

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

It would be nice to have a longer, more explanatory message here.

Copy link
Member

Choose a reason for hiding this comment

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

Maybe "Traits with opaque functions can now be extended without errors" or something like that.

@MikaelMayer MikaelMayer self-assigned this Jul 11, 2023
Copy link
Member

@atomb atomb left a comment

Choose a reason for hiding this comment

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

Looks good!

@MikaelMayer MikaelMayer merged commit 4df64dd into master Jul 12, 2023
19 checks passed
@MikaelMayer MikaelMayer deleted the fix-4205-extending-trait-with-an-opaque-function-causes branch July 12, 2023 15:02
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.

Extending a trait with an opaque function causes error, but only on the commandline and not on VSCode.
2 participants