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
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@alandonovan
Copy link
Contributor

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
Contributor

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

@quentinmit quentinmit added the NeedsFix The path to resolution is known, but the work has not been done. label Nov 4, 2016
@quentinmit quentinmit added this to the Go1.8 milestone Nov 4, 2016
@griesemer
Copy link
Contributor

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

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

@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.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants