]> Cypherpunks repositories - gostls13.git/commit
go/types: match types2 error for invalid map key
authorRobert Griesemer <gri@golang.org>
Thu, 18 Aug 2022 23:59:10 +0000 (16:59 -0700)
committerRobert Griesemer <gri@golang.org>
Fri, 19 Aug 2022 19:39:50 +0000 (19:39 +0000)
commit6bedf4a2b45068c486c69a04410f2c2469152f2d
treeaecb549cc0caaec9c9f34a7b41105f0a3323ce72
parent9a1d3b0ad20ba5d73ba3a88c86563ae7b4cf03ca
go/types: match types2 error for invalid map key

Use "invalid" rather than "incomparable" in error message for map key
types that are not comparable. This is the original compiler error
message and many tests check for this specific message. The type
checker does provide an additional explanation if the reason for
the error is not obvious (e.g. for type parameters).

For #54511.

Change-Id: Idb76c48b4dfbfd66a7deac728a552e07f14e06d7
Reviewed-on: https://go-review.googlesource.com/c/go/+/424905
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
src/go/types/testdata/check/cycles0.go
src/go/types/testdata/check/typeparams.go
src/go/types/typexpr.go