]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.typeparams] cmd/compile/internal/types2: use comparable bit rather than ==(...
authorRobert Griesemer <gri@golang.org>
Mon, 26 Jul 2021 21:50:57 +0000 (14:50 -0700)
committerRobert Griesemer <gri@golang.org>
Tue, 27 Jul 2021 21:21:00 +0000 (21:21 +0000)
commitc751e2e6ba30fc319c93b9cfe207dc7d1b48c3fb
treed4b7355ff1fe7ed9b985d1a6f639957863d7f9c5
parent5d8f90f90405e9faa9c5425627024d2cfa67faa3
[dev.typeparams] cmd/compile/internal/types2: use comparable bit rather than ==() method

This removes the special "==" methods from comparable interfaces in
favor of a "comparable" flag in TypeSets indicating that the interface
is or embeds comparable. Fixes various related implementation
inaccuracies.

While at it, fix setup of the predeclared error and comparable
interface types by associating their respective type name objects
with them.

For #47411.

Change-Id: I409f880c8c8f2fe345621401267e4aaabd17124d
Reviewed-on: https://go-review.googlesource.com/c/go/+/337354
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
src/cmd/compile/internal/types2/instantiate.go
src/cmd/compile/internal/types2/interface.go
src/cmd/compile/internal/types2/lookup.go
src/cmd/compile/internal/types2/predicates.go
src/cmd/compile/internal/types2/sizeof_test.go
src/cmd/compile/internal/types2/testdata/check/issues.go2
src/cmd/compile/internal/types2/testdata/fixedbugs/issue47411.go2 [new file with mode: 0644]
src/cmd/compile/internal/types2/typeset.go
src/cmd/compile/internal/types2/universe.go