-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/compile: off-by-many in line number reported for compile error #8836
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
Actually this has nothing to do with cgo, the Go compiler has the same problem. http://play.golang.org/p/XgU4-2ryvT |
@dr2chase another |
This looks intractable and annoying -- I think the root cause is our tendency to sometimes construct ASTs that aren't trees, so that when an argument to a function call is a shared node in the AST its line number is not trustworthy. It is possible to get it right for numbers, but not for boolean constants true and false. You can see the hackiness in setlineno around line 230 of subr.go; that uses the line number of a node to set the global lineno (a hack in itself if you ask me) but only when the node is not a ONAME, OTYPE, OPACK, or OLITERAL. |
CL https://golang.org/cl/11672 mentions this issue. |
The text was updated successfully, but these errors were encountered: