-
Notifications
You must be signed in to change notification settings - Fork 257
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
Assert for the elephant let-or-fail operator in expressions #1791
Comments
This makes sense for |
I get your point in this particular case; however, there is no guarantee in the general case that |
Then why not just call |
Good point. But then, why support the keyword |
I was not aware of that syntax, and it's mightily confusing!
does not mean the same as
Normally |
This ambiguity is actually documented in the Dafny reference already. I don't think it's a problem, you can disambiguate with parentheses, and the first syntax gives a handy way to assert that something should return a success and return its value at the same time. |
cf. #1434 |
It's possible to write the following:
but let's say I would like to assert that SubTest won't fail (because of some conditions in the inputs of SubTest).
In methods, it's possible to prefix the call to
SubTest
withassert
, and it will emit the assertion. However, it's not possible for functions yet.It would be however obvious that
should be rewritten to:
The same goes for the
assume
andexpect
keywords, since many users usefunction methods
, might use them for testing, and also to assume something before coming back to it and revisiting the keyword later.The text was updated successfully, but these errors were encountered: