-
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
go/ast: Decl field for variables declared in range clause does not point to range statement #5241
Labels
Comments
Per Michael Fromberger: "Yes, I think the RangeStmt would be the correct place. In general, I would argue the declaration should always be a node that will be visited in an ordinary traversal of the AST.* So, I would also be okay with having RangeStmt contain an AssignStmt node as one of its children, and having that be the declaration for the identifiers (when appropriate)." |
The preferred mechanism to obtain the correct objects for identifiers is to use go/types now: For each identifier, go/type will report the corresponding types.Object (defs, uses, coming shortly). A reverse mapping (object -> defining identifier) is easily computed from that. The defining identifier appears in the AST and is not synthetic. Status changed to Unfortunate. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: