cmd/compile: incorrect error message for types check in generic functions #59312
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes, at lest in go.1.18
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
GO code:
What did you expect to see?
Error message about wrong type of the first argument
v
asfloat64
is not a part of typevalues
.What did you see instead?
Compile error:
It is wrong and very confusing error message as function has correct type. Type of its parameter compared with the first parameter type instead of comparison to type
values
.In opposite: the
v
argument has incorrect type (according to typevalues
definition) but this is not reported as error.The text was updated successfully, but these errors were encountered: