-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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/cgo: shifting identifier position in ast #42580
Comments
I’ve made a little investigation:
Passing this snippet to cgo and comparing the result I've noticed that there is no information about the end of original type identifier in type cast expression.
There should be another one “line” comment to fix the identifier position in the first case .
|
Change https://golang.org/cl/269760 mentions this issue: |
Can I help with any further work? |
Thanks for the ping. I made some comments on the change. |
ping @ianlancetaylor |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I worked on my task related to ast processing.I faced unexpected behaviour in the AST for code compiled with cgo.
I wrote some simplified test function to represent the bug.
package pg
What did you expect to see?
checkedPointer first symbol has 56 column.
When I set second parameter to nil the result ast is correct
What did you see instead?
checkedPointer first symbol has 61 column in ast.
Test Cases
https://play.golang.org/p/w7MiDEKg7bx
The text was updated successfully, but these errors were encountered: