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: TypeList has a String method, but TypeParamList does not #50760

Closed
findleyr opened this issue Jan 22, 2022 · 2 comments
Closed

go/types: TypeList has a String method, but TypeParamList does not #50760

findleyr opened this issue Jan 22, 2022 · 2 comments
Labels
FrozenDueToAge NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone

Comments

@findleyr
Copy link
Contributor

findleyr commented Jan 22, 2022

Issue #47916 does not document the String method for types.TypeList (added in https://go.dev/cl/346552 to aid with debugging). Furthermore the otherwise symmetric TypeParamList type does not have a String method.

These two list types should be symmetric. Since types.TypeList.String was not covered by the proposal, probably we should remove this method and propose it for 1.19.

CC @griesemer

@findleyr findleyr added this to the Go1.18 milestone Jan 22, 2022
@griesemer
Copy link
Contributor

Removing String from types.TypeList is fine, but we should ensure that we're not breaking any (possibly debugging) output that uses %s and relies on TypeList implementing Stringer.

On the other hand, there's also a format question for types.TypeParamList.String: what exactly should it print? (actual type parameter list with square brackets and constraints? just the type parameter names?)

@mknyszek mknyszek added the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Jan 24, 2022
@gopherbot
Copy link

Change https://golang.org/cl/381634 mentions this issue: go/types, types2: delete TypeList.String

@golang golang locked and limited conversation to collaborators Jan 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Projects
None yet
Development

No branches or pull requests

4 participants