cmd/compile: "type does not match inferred type" even though it compiles when the inferred type is explicitly provided as type argument #53389
Labels
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
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?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I tried compiling the below program.
https://go.dev/play/p/QcWycysXf-F?v=gotip
What did you expect to see?
I expected
F(x, Y{})
to be equivalent toF[any](x, Y{})
, and thus compile without issue.What did you see instead?
F(x, Y{})
failed to compile with the following error:The text was updated successfully, but these errors were encountered: