-
Notifications
You must be signed in to change notification settings - Fork 446
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
Reject yielding a value to the top of a loop #277
Comments
That would not be consistent with the type system which discards values not consumed. What extensions do you have in mind. |
This change would be subsumed by the more general change to remove the void-subtyping rule (since the loop label has type void). |
@lukewagner That would seem to imply adding a |
A |
@sunfishcode, yes, this is a consequence of #271, and your complaint is the same as the original issue #179, so we already went back and forth on this one. But as @lukewagner said, with explicit drops this would be resolved for good. |
Even if a discard operator is added there is more to this. For example the following would still be valid which might not 'reserve room for making branches to loop tops to be extended in the future'.
|
This is obsolete with the new |
Lost the token in the parser during rebases.
This got lost in the rebase too, and WebAssembly#277 only partially fixed it.
The following code currently validates in the ml-proto interpreter:
This isn't useful, because the
(i32.const 0)
value isn't actually used, since the branch is going to the top of a loop.I propose that this be made a validation error, both to diagnose accidental use, and to reserve room for making branches to loop tops to be extended in the future.
The text was updated successfully, but these errors were encountered: