From bcb3927cb51af39f44d810aab809dff27c950697 Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Fri, 4 Jun 2021 23:01:13 -0700 Subject: [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 Trust: Dan Scales Run-TryBot: Keith Randall TryBot-Result: Go Bot Reviewed-by: Dan Scales --- src/cmd/compile/internal/types/type.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/cmd/compile/internal/types/type.go') 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 -- cgit v1.2.3-54-g00ecf