Skip to content
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/types: incorrect Info.Uses map entry for struct { a } where a is an alias #17778

Closed
alandonovan opened this issue Nov 3, 2016 · 2 comments
Closed
Assignees
Milestone

Comments

@alandonovan
Copy link
Contributor

@alandonovan alandonovan commented Nov 3, 2016

The Uses map entry for struct { a } ought to be the Alias object for type alias a, not its original type.
However, the logic in (*Checker).structType calls recordUse on the TypeName derived from the computed type of the field, rather than the object (type or type alias) with which the field is declared.

In at least some cases, such as a simple ident, the recordUse call made by the add function within structType is redundant, since check.typeExpr(f.Type) already calls recordUse.

@gopherbot
Copy link

@gopherbot gopherbot commented Nov 3, 2016

CL https://golang.org/cl/32710 mentions this issue.

Loading

@quentinmit quentinmit added this to the Go1.8 milestone Nov 4, 2016
@griesemer
Copy link
Contributor

@griesemer griesemer commented Nov 4, 2016

Decision to back out current alias implementation. See #16339. Closing.

See also: https://go-review.googlesource.com/32837

Loading

@griesemer griesemer closed this Nov 4, 2016
@golang golang locked and limited conversation to collaborators Nov 5, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants