]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile: support type C comparable
authorDan Scales <danscales@google.com>
Thu, 26 Aug 2021 00:12:27 +0000 (17:12 -0700)
committerDan Scales <danscales@google.com>
Sat, 28 Aug 2021 16:00:51 +0000 (16:00 +0000)
commitd7a43e89124044f0f468e656ec17a3cc86916b33
tree20e6384d9115d5dbb427d7a05de33211ef1c5a6d
parent044550ab0ee28fe85b98600503c9f33642697d76
cmd/compile: support type C comparable

Support 'type C comparable' properly by using the same logic as for
'type T error', since ErrorType and ComparableType are entirely
analogous.

Added support for 'any' type as well, as requested by Robert. (For the
future - we can't currently have 'any' anywhere other than in a
constraint.)

Fixes #47966

Change-Id: I68bd284ced9a8bfca7d2339cd576f3cb909b1b83
Reviewed-on: https://go-review.googlesource.com/c/go/+/345174
Trust: Dan Scales <danscales@google.com>
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Dan Scales <danscales@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/cmd/compile/internal/typecheck/bexport.go
src/cmd/compile/internal/typecheck/iexport.go
src/cmd/compile/internal/types/type.go
src/cmd/compile/internal/types/universe.go
test/typeparam/issue47966.go [new file with mode: 0644]
test/typeparam/subdict.go