diff options
author | Robert Findley <rfindley@google.com> | 2021-11-09 16:41:01 -0500 |
---|---|---|
committer | Robert Findley <rfindley@google.com> | 2021-11-10 00:44:59 +0000 |
commit | f5f94340910421baea624ca08e5f51343515cae8 (patch) | |
tree | 463f8dab50f6e68c2c3221b70ca163f2349b3a25 /src/go/types/predicates.go | |
parent | 578ada410de8065dbca46bca08a5993d1307f423 (diff) | |
download | go-f5f94340910421baea624ca08e5f51343515cae8.tar.gz go-f5f94340910421baea624ca08e5f51343515cae8.zip |
go/types: remove most asX converters (cleanup)
This is a port of CL 362118 to go/types, which is itself a roll-forward
of CL 362254, containing a bugfix.
Change-Id: I20067c7adf56bf64fe9ad080d998a7aefbdc1053
Reviewed-on: https://go-review.googlesource.com/c/go/+/362617
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Diffstat (limited to 'src/go/types/predicates.go')
-rw-r--r-- | src/go/types/predicates.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/go/types/predicates.go b/src/go/types/predicates.go index 622c773126..e8689a12cc 100644 --- a/src/go/types/predicates.go +++ b/src/go/types/predicates.go @@ -74,7 +74,7 @@ func hasName(t Type) bool { // are not fully set up. func isTyped(t Type) bool { // isTyped is called with types that are not fully - // set up. Must not call asBasic()! + // set up. Must not call under()! b, _ := t.(*Basic) return b == nil || b.info&IsUntyped == 0 } @@ -86,7 +86,8 @@ func isUntyped(t Type) bool { // IsInterface reports whether t is an interface type. func IsInterface(t Type) bool { - return asInterface(t) != nil + _, ok := under(t).(*Interface) + return ok } // isTypeParam reports whether t is a type parameter. |