-
Notifications
You must be signed in to change notification settings - Fork 112
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
Undo revert 966 and add fixes #968
Conversation
e38b443
to
160b0f7
Compare
|
||
namespace VCGeneration; | ||
|
||
public class ImplicitJump : TokenWrapper { |
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.
Is it possible that this token could nest another nested token? If that is the case, I would prefer to see a parameter bool ImplicitJump
inside TokenWrapper which should then be a record, to avoid what we experienced in Dafny with unexpected piles of token wrappers that are hard to unfold properly, especially when the order should not matter.
You can then have an extension method method WithImplicit(this IToken token)
that, if the token is already wrapped, copy it while setting the implicit flag, and otherwise wrap it with a wrapped token accordingly
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.
Great callout. I've changed the check from originalReturn.tok is ImplicitJump
to originalReturn.tok is not Token
so that any wrapping, which I think indicates it's generated code, will prevent a separate VC from being generated.
I find it hard to say what implementation is the most maintainable here, without having more cases of token wrapping to reason with, so I hope we can leave it at this and stay vigilant.
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.
Just reviewed the last two commits, trusted the previous review of the un-revert
Note: review per commit and skip the first one, since that's an unrevert, so the code was previously reviewed approved and merged.
Changes
{:vcs_split_on_every_assert}
is used, so we get #returns * #ensures additional VCs from return statements.Testing