-
Notifications
You must be signed in to change notification settings - Fork 92
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
Contracts: History Expressions via "old" monad #3232
Conversation
@JustusAdam could you give another review? |
Co-authored-by: Felipe R. Monteiro <rms.felipe@gmail.com>
Co-authored-by: Felipe R. Monteiro <rms.felipe@gmail.com>
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 to me otherwise
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 please add a few ui/
tests where the user misuses the API, for example:
- User tries to pass an object of type
T: !Copy
toold
. old
has no argument.old
argument is not an expression.- User tries to pass
result
toold
.
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.
Thanks for adding the ui
tests. I think we need to work on these error messages though. I'm OK with making it a follow up PR, but I'll leave it up to you and @feliperodri.
Add support for History Expressions. This allows an ensures clause to evaluate expressions before the function runs, bing them to anonymous variables and use them after calculating the result to be able to compare to the state before the function evaluation.
Resolves #2803
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.