cmd/go2go: error message for mismatched arguments does not reference both arguments' types #39725
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Does this issue reproduce with the latest release?
This occurs in the playground at the time of writing.
What did you do?
Try to run the following program:
https://go2goplay.golang.org/p/1NaVjWeT2xW
What did you expect to see?
The error message explicitly points out that two different types were substituted for
T
in the call toAny
(and what the types were), perhaps like this:type func(f []byte) bool of (func(f []byte) bool literal) does not match func(string) bool
What did you see instead?
type func(f []byte) bool of (func(f []byte) bool literal) does not match func(T) bool
This message is unhelpful as, unlike in non-generic code, it doesn't tell us which type we should have used, and does not reveal the fundamental problem - the mismatch between
string
and[]byte
.The text was updated successfully, but these errors were encountered: