aboutsummaryrefslogtreecommitdiff
path: root/src/go/types/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/go/types/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/go/types/predicates.go')
-rw-r--r--src/go/types/predicates.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/go/types/predicates.go b/src/go/types/predicates.go
index 0360f27ee6..51d056f355 100644
--- a/src/go/types/predicates.go
+++ b/src/go/types/predicates.go
@@ -87,6 +87,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)