spec: type inference can't infer types for a generic union of functions #56975
Labels
generics
Issue is related to generics
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Proposal-Hold
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?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Try to use type inference for a generic interface whose only member is a union of functions
https://go.dev/play/p/uPJQhqqwMk0
What did you expect to see?
Program compiled successfully
What did you see instead?
./prog.go:12:5: cannot infer T (prog.go:7:10)
If the interface doesn't have a union then type inference works as expected:
https://go.dev/play/p/B-yRqxfvaK0
The text was updated successfully, but these errors were encountered: