cmd/go2go: can't call function with generic type that implements generic interface #40018
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Consider the following (playground):
In short, we have a generic interface
I(T)
, a generic typeS(T)
which implements it, and a function which accepts anI(T)
. Given a value of typeS(int)
, we can assign it toI(int)
, but we can only pass the function if we explicitly pass the type parameter. If we don't, we get an errortype S(int) of s does not match I(T)
. Offhand, I would think the compiler should be able to infer just fine here, but if not it should just saycannot infer T
.The text was updated successfully, but these errors were encountered: