-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/compile: fail to capture invalid field name in struct initializer #15311
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
Nice find! Indeed, it's a recent regression:
|
Regression introduced by 5f525ca. /cc @ianlancetaylor |
This is a little tricky, because the parser has already resolved (or tried to resolve) names, including package-qualified names as well as dot-imported names. In particular, I'm not sure off hand how to best handle:
because at this point Relatedly, I discovered that cmd/compile erroneously accepts
even though the fmt import isn't actually used. The parser is misrecognizing the "Println: 0" as a use of fmt.Println and marking fmt as used. (gccgo-4.8 also accepts it; gotype correctly rejects it.) |
CL https://golang.org/cl/22162 mentions this issue. |
The following snippet can compile with tip,
though, go1.4 fails with the following:
The text was updated successfully, but these errors were encountered: