diff options
author | Robert Griesemer <gri@golang.org> | 2021-11-11 16:02:35 -0800 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2021-11-12 22:20:50 +0000 |
commit | 9150c16bced33ca591a55fe4fb64817dd659b285 (patch) | |
tree | 21a156e39787cc65e64941f4c8773cff2ebbe40c /src/cmd/compile/internal/types2/predicates.go | |
parent | 363459479014bde19e83d9fb6781310f63fb0b45 (diff) | |
download | go-9150c16bced33ca591a55fe4fb64817dd659b285.tar.gz go-9150c16bced33ca591a55fe4fb64817dd659b285.zip |
cmd/compile/internal/types2: remove asTypeParam and simplify some code
Because we do not permit a stand-alone type parameter on the RHS of
a type declaration, the underlying type of a (Named) type cannot be
a type parameter. This allows us to simplify some code.
Specifically, when parsing union elements, we don't need to delay
a check for later, which allows further simplifications when computing
type sets.
Change-Id: I4047c609f87ebb194ea8c1bad630a70d255b20cf
Reviewed-on: https://go-review.googlesource.com/c/go/+/363438
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
Diffstat (limited to 'src/cmd/compile/internal/types2/predicates.go')
-rw-r--r-- | src/cmd/compile/internal/types2/predicates.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/types2/predicates.go b/src/cmd/compile/internal/types2/predicates.go index f1fd33c5de..5cb1c33814 100644 --- a/src/cmd/compile/internal/types2/predicates.go +++ b/src/cmd/compile/internal/types2/predicates.go @@ -90,7 +90,7 @@ func IsInterface(t Type) bool { // isTypeParam reports whether t is a type parameter. func isTypeParam(t Type) bool { - _, ok := under(t).(*TypeParam) + _, ok := t.(*TypeParam) return ok } |