go/types, cmd/compile/internal/types2: type parameter inference fails for constraints that succeed individually #66751
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
TypeInference
Issue is related to generic type inference
Milestone
Go version
go version go1.22.1 linux/amd64
Output of
go env
in your module/workspace:What did you do?
https://go.dev/play/p/fVSkvTEgYx_1
What did you see happen?
Inference succeeds on all three calls.
What did you expect to see?
Inference succeeds on the first two but fails on the third. If inference of B for
withPtr
orwithFoo
failed, it would make sense. But inference succeeds on both of those so it's surprising and confusing that it fails forwithBoth
.The text was updated successfully, but these errors were encountered: