-
Notifications
You must be signed in to change notification settings - Fork 17.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
cmd/compile: incorrect column reported for invalid struct field names #24339
Comments
This does not concern go/parser; rather, this is the compiler. The error comes from I also believe that this is working as intended, as the position of the key-value expression is the position of the colon token. There was an issue where @mdempsky suggested that, in the new syntax package, node positions shouldn't always be their start position. For example, in Having said that, I can understand that the error concerns the field name, not the entire key-value expression. Perhaps the error in this case should use the position for the field, and not the entire key-value expression. Also cc @griesemer. |
Found the issue now; it's #16943. |
Package syntax provides all the relevant positions here. It's just a matter of using the right one. Will fix. |
Change https://golang.org/cl/100457 mentions this issue: |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go1.10
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?What did you do?
Tried to compile this (incorrect code):
What did you expect to see?
What did you see instead?
Go Playground: https://play.golang.org/p/-UT1IgmXgQD
The text was updated successfully, but these errors were encountered: