cmd/compile: different results between inferred generic type argument and explicit generic type argument #61741
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
Thinking
TypeInference
Issue is related to generic type inference
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
It is currently reproducing on the latest gotipplay
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
https://gotipplay.golang.org/p/sUrlIpN1rLa
Given a generic interface+function pair:
and a valid implementation of the above interface:
and the two calls below:
The generic type inference can correctly infer the type for WriteFile in the second case, and it matches the explicit type argument from the first call, but it still gives an error.
What did you expect to see?
I expect both of these lines to work:
What did you see instead?
The text was updated successfully, but these errors were encountered: