-
Notifications
You must be signed in to change notification settings - Fork 259
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
Fix: Handling of opaque methods in traits overriding check #4207
Conversation
There was a problem hiding this 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); |
There was a problem hiding this comment.
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.
docs/dev/news/4205.fix
Outdated
@@ -0,0 +1 @@ | |||
Handling of opaque methods in traits overriding check |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
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.