-
Notifications
You must be signed in to change notification settings - Fork 361
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
Implement short-circuiting for assertions #865
Conversation
Compile config should be updated in the |
changed |
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.
LGTM!
currently
would always panic if
foo()
panics (even ifc
in false)This is because we inline foo(), and conditionally return its result, but if a panic happened in the statements of foo, it would happen even if this branch isn't executed.
With this change, panics in each branch lead to the whole execution panicking only if the given branch is "executed", ie if
c
is true.Both branches are still technically being executed (and paid for in terms of constraints), but the behavior is closer to what would expect.
Todo: