-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/compile: invalid literal causes errors in subsequent lines of valid code #15611
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
This was fine in Go 1.4 and Go 1.5 and regressed in Go 1.6, not this cycle, so we can probably live with it for another cycle.
/cc @griesemer @mdempsky |
Worth looking into for 1.8 for any way we can improve this, but in general recovering from syntax errors is always going to be best effort. The reason you get two |
For the reference, gotype simply reports for the example above:
which is probably the best error message in this case. The reason is that the go/scanner accepts rune literals with multiple characters and complains if there's more than one. This seems to work better in this specific case. |
CL https://golang.org/cl/37138 mentions this issue. |
Tried to compile the following (https://play.golang.org/p/hbj73GGYMU):
No errors should have been reported for lines 5 and 6.
missing '
probably should have been reported just once.The text was updated successfully, but these errors were encountered: