You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here's a very simple case where types2 is not giving an error when a method is missing one of the required typeparams for its generic receiver type. This only appears to happen because the typeparam PT is expressed in terms of T (structural constraint). The error is properly reported if we change PT *T to PT any
This is due to constraint type inference at the receiver type expression.
See also #51233 -- these are not really related, but both suggest to me that type inference for type instances is too naive, and we (I) didn't give it enough thought.
I don't think we should ever allow type inference at the receiver type expression. The spec is clear that we need to provide all type parameters in that case. When we do, the error goes away as far as I can tell.
Originally posted by @mpx in #51232 (comment)
go version devel +c9fe126c8b Mon Feb 21 21:28:40 2022 +0000 linux/amd64
From
..at least, the call chain is more or less the same compared to @dr2chase's example:
The text was updated successfully, but these errors were encountered: