go/types, types2: type parameter type string is misleading #49215
Labels
FrozenDueToAge
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
release-blocker
Milestone
As we focus on error messages, both in the type checker and in vet, I am becoming increasingly concerned that the type parameter type string is misleading.
For example, when running vet on the following code
We end up with diagnostics like this:
In these cases the qualification of
pkg.P
is almost always misleading -- it looks like a named type.I can think of several ways to proceed:
GobDecode(P)
GobDecode(pkg.U.GobDecode.P)
(assuming we associate with the method).GobDecode($P)
(this is like (2) but unambiguous when using e.g.types.RelativeTo
as a qualifier).Type parameters only have meaning in the scope in which they are bound. For that reason, maybe it's sufficient for their type string to just be their name, as in option (2). Option 3 is precise, but verbose. I like the look of option 4, but it is rather risky.
CC @griesemer @mdempsky
The text was updated successfully, but these errors were encountered: