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: documentation on Type.Underlying needs clarification #51036

Closed
dominikh opened this issue Feb 6, 2022 · 2 comments
Closed

go/types: documentation on Type.Underlying needs clarification #51036

dominikh opened this issue Feb 6, 2022 · 2 comments
Labels
Documentation FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@dominikh
Copy link
Member

dominikh commented Feb 6, 2022

The documentation for (go/types.Type).Underlying says

Underlying returns the underlying type of a type w/o following forwarding chains.

but doesn't specify what a "forwarding chain" is. At first hunch one might assume it means type T1 int; type T2 T1, but T2's underlying type is int.

/cc @findleyr

@dominikh dominikh added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Feb 6, 2022
@findleyr findleyr self-assigned this Feb 13, 2022
@findleyr
Copy link
Contributor

Thanks, I think this was actually a regression in 1.17, and nobody noticed :(

That commentary about forwarding chains relates to expansion of instances on the RHS of type declaration, and should not leak into the external documentation.

I'll fix this for 1.18.

CC @griesemer

@findleyr findleyr added this to the Go1.18 milestone Feb 13, 2022
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/388036 mentions this issue: go/types,types2: revert documentation for Type.Underlying

@golang golang locked and limited conversation to collaborators Jun 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Documentation FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants