aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/types2/predicates.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2021-11-11 16:02:35 -0800
committerRobert Griesemer <gri@golang.org>2021-11-12 22:20:50 +0000
commit9150c16bced33ca591a55fe4fb64817dd659b285 (patch)
tree21a156e39787cc65e64941f4c8773cff2ebbe40c /src/cmd/compile/internal/types2/predicates.go
parent363459479014bde19e83d9fb6781310f63fb0b45 (diff)
downloadgo-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.go2
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
}