aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/types/type.go
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2021-06-04 23:01:13 -0700
committerKeith Randall <khr@golang.org>2021-06-07 19:51:26 +0000
commitbcb3927cb51af39f44d810aab809dff27c950697 (patch)
tree1a09ed62b96fc95c7a46390c75b082b61d0c426f /src/cmd/compile/internal/types/type.go
parentf0c97219a3bc5f5c21863c68d4ccf2fb73002d8c (diff)
downloadgo-bcb3927cb51af39f44d810aab809dff27c950697.tar.gz
go-bcb3927cb51af39f44d810aab809dff27c950697.zip
[dev.typeparams] cmd/compile: introduce IsTypeParam() helper
better than Kind() == types.TTYPEPARAM Change-Id: I4f35a177cd0cda3be615a92b7b2af1b5a60a3bbc Reviewed-on: https://go-review.googlesource.com/c/go/+/325410 Trust: Keith Randall <khr@golang.org> Trust: Dan Scales <danscales@google.com> Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Dan Scales <danscales@google.com>
Diffstat (limited to 'src/cmd/compile/internal/types/type.go')
-rw-r--r--src/cmd/compile/internal/types/type.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/types/type.go b/src/cmd/compile/internal/types/type.go
index a3a6050c52..075009d6a3 100644
--- a/src/cmd/compile/internal/types/type.go
+++ b/src/cmd/compile/internal/types/type.go
@@ -1487,6 +1487,10 @@ func (t *Type) IsUnion() bool {
return t.kind == TUNION
}
+func (t *Type) IsTypeParam() bool {
+ return t.kind == TTYPEPARAM
+}
+
// IsEmptyInterface reports whether t is an empty interface type.
func (t *Type) IsEmptyInterface() bool {
return t.IsInterface() && t.AllMethods().Len() == 0