aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/types2/predicates.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2022-03-10 21:50:54 -0800
committerRobert Griesemer <gri@golang.org>2022-03-21 19:10:06 +0000
commit63c7614fd05052009c1eee061964241e4d73c6a1 (patch)
tree94b97e96e6a2b80e77b94f0c8f5ceb4ac4bf1539 /src/cmd/compile/internal/types2/predicates.go
parent79103faf2d85d60c14702329964dc390e3057603 (diff)
downloadgo-63c7614fd05052009c1eee061964241e4d73c6a1.tar.gz
go-63c7614fd05052009c1eee061964241e4d73c6a1.zip
go/types, types2: factor out isInterface(x) && !isTypeParam(x) (cleanup)
Fixes #51581. Change-Id: I3232428edd7dd86f2930af950fb5841f7394c4e5 Reviewed-on: https://go-review.googlesource.com/c/go/+/391834 Trust: Robert Griesemer <gri@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.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/types2/predicates.go b/src/cmd/compile/internal/types2/predicates.go
index ba259341f6..6bce26137e 100644
--- a/src/cmd/compile/internal/types2/predicates.go
+++ b/src/cmd/compile/internal/types2/predicates.go
@@ -85,6 +85,11 @@ func IsInterface(t Type) bool {
return ok
}
+// isNonTypeParamInterface reports whether t is an interface type but not a type parameter.
+func isNonTypeParamInterface(t Type) bool {
+ return !isTypeParam(t) && IsInterface(t)
+}
+
// isTypeParam reports whether t is a type parameter.
func isTypeParam(t Type) bool {
_, ok := t.(*TypeParam)