-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/gc: inlining unparenthesizes struct literals in if statements. #4230
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
Labels
Milestone
Comments
This is not a syntax error. What happens is that the inlining information is missing the parentheses that make the if statement grammatically correct. See the spec: A parsing ambiguity arises when a composite literal using the TypeName form of the LiteralType appears between the keyword and the opening brace of the block of an "if", "for", or "switch" statement, because the braces surrounding the expressions in the literal are confused with those introducing the block of statements. To resolve the ambiguity in this rare case, the composite literal must appear within parentheses. Labels changed: added priority-later, compilerbug, removed priority-triage. Status changed to Accepted. |
This issue was closed by revision 319131f. Status changed to Fixed. |
This issue was closed by revision 20ebee2. |
adg
added a commit
that referenced
this issue
May 11, 2015
…rted if statements. ««« CL 10470043 / d04e6b0bcacf cmd/gc: fix pointer composite literals in exported if statements. Fixes #4230 (again). R=rsc, golang-dev, r CC=golang-dev https://golang.org/cl/10470043 »»» Update #5928 R=golang-dev, dave CC=golang-dev https://golang.org/cl/11455045
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: