-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/compile: misleading error when supplying a statement as a function parameter #15307
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
Comments
Not limited to function parameters:
Also
gives the same double error. Seems like the parser is confused by certain syntax issues when inside |
Except for grouping of declarations (icl. parameter declarations), inside ()'s we can only have expressions. Possibly error recovery could be a bit stronger in that case. |
It's tricky to come up with a good parser recovery strategy in cases like these. The culprit is the
If a
This will fix these issues, but cause others (run the tests). Leaving open for further exploration. Not urgent. |
This appears to be fixed in c37090f. |
Confirming. Thanks for noticing this, @0xmohit . |
Tried to compile the following:
The second error should be suppressed. (It's not observed using 1.5.3 and earlier.)
The text was updated successfully, but these errors were encountered: