View the error "side effect" as first class. #762
waalge
started this conversation in
Core language features
Replies: 2 comments 3 replies
-
I am not sure to understand your issue? Is it that you want to use "expect" as the last expression in a block? In which case, this is indeed not allowed as expect is fundamentally a let-binding with extra verifications. |
Beta Was this translation helpful? Give feedback.
3 replies
-
I understand the sentiment. I kinda want to rework tests specifically to only operate with expect. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
For example using an
if else
block to check a few conditions with expects requires a return even if none is needed.Type checker says.
If there is a return statement then let me know I don't use it. If it's void, then check the code concludes with expect statements and assume I know what i'm doing.
I think I don't keep too much company in thinking that "pretend validators are boolean functions" was/is a mistake.
Validators can fail fast. I don't need to
and
a bunch of conditions if I already found a failure.It leads to:
Beta Was this translation helpful? Give feedback.
All reactions