go/types: NewSignatureType mutates its TypeParams, and panics unless they are new #67293
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
If a client of go/types uses NewSignatureType to create a variation on an existing type, it is an error to pass the TypeParams of the existing function, as bindTParams will update their index field, and panic if the field has already been set.
I think there are two separate issues here:
Offending client code:
(Gopls uses NewSignatureType to truncate long parameter lists so that they can be formatted using TypeString or WriteSignature. If the machinery of TypeString provided more control over the traversal this would not be necessary.)
@gri @findleyr
The text was updated successfully, but these errors were encountered: