]> Cypherpunks.ru repositories - gostls13.git/commit
go/types, types2: improve error messages referencing any
authorRobert Findley <rfindley@google.com>
Mon, 15 Nov 2021 14:42:03 +0000 (09:42 -0500)
committerRobert Findley <rfindley@google.com>
Tue, 16 Nov 2021 15:59:43 +0000 (15:59 +0000)
commit79d0013f53d4199b9f84d813221b71adf7eb1e4d
treecca478dae811b7dd659389219cbcebe8f28eafe4
parent7f4a946fa26f2ffdc14c354f2f1cc193ab5d0e90
go/types, types2: improve error messages referencing any

Because any is an a alias, it is naively formatted as interface{} in
error messages. This is a source of verbosity and potential confusion.

We can improve the situation by looking for pointer equality with the
any type. To avoid churn in the importers, do this all at once across
the compiler, go/types, and go/internal/gcimporter. CL 364194 makes the
corresponding change in x/tools/go/internal/gcimporter, allowing the
x/tools trybots to pass.

Fixes #49583

Change-Id: Ib59570937601308483f6273364cc59338f9b8b3b
Reviewed-on: https://go-review.googlesource.com/c/go/+/363974
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
15 files changed:
src/cmd/compile/internal/importer/support.go
src/cmd/compile/internal/noder/types.go
src/cmd/compile/internal/types2/api_test.go
src/cmd/compile/internal/types2/object.go
src/cmd/compile/internal/types2/object_test.go
src/cmd/compile/internal/types2/testdata/fixedbugs/issue48008.go2
src/cmd/compile/internal/types2/typestring.go
src/cmd/compile/internal/types2/universe.go
src/go/internal/gcimporter/support.go
src/go/types/api_test.go
src/go/types/object.go
src/go/types/object_test.go
src/go/types/testdata/fixedbugs/issue48008.go2
src/go/types/typestring.go
src/go/types/universe.go