-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Can't use labeled block as if body? #5108
Comments
Forgot to mention -- I am using zig-linux-x86_64-0.6.0+986aa42d3.tar.xz on an up-to-date |
The
We should probably call that out specifically in the docs, it's kind of hard to see. |
... Or we could remove the need for the else miss: {
break miss ret_val;
}; |
Thank you very much. I will comment that this is a bit of syntax that merits reconsideration. |
Relevant proposal: #5083 |
This code:
Results in this error:
I am trying to use the if as expression, returning a value from either leg of the if. The else side
involves more than one statement, so I believe I need to use a labeled block to return a value from it. The compiler isn't buying it. Comments? Suggestions?
The text was updated successfully, but these errors were encountered: