cmd/compile: "cannot infer T" in Go 1.21 (regression from Go 1.20) #63873
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
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?
Run this program: https://go.dev/play/p/jx329NFz7ZU
What did you expect to see?
It compiles.
What did you see instead?
It fails to compile in Go 1.21, while it still compiled in Go 1.20.
Go 1.21 error message:
I have code like this as an assert to verify that
v
(in the main function) is of a particular type.The text was updated successfully, but these errors were encountered: