diff options
author | Robert Findley <rfindley@google.com> | 2021-11-08 18:08:59 +0000 |
---|---|---|
committer | Robert Findley <rfindley@google.com> | 2021-11-09 16:55:47 +0000 |
commit | 34abc12b2a24fd76cdfad531f0a229f3cbb55bc3 (patch) | |
tree | e989df58448556b1d91fdf5fa03f7362e3899eea /src/cmd/compile/internal/types2/predicates.go | |
parent | 47e3c4bc74f5f260cbc9c5e6d1ababde0a114a97 (diff) | |
download | go-34abc12b2a24fd76cdfad531f0a229f3cbb55bc3.tar.gz go-34abc12b2a24fd76cdfad531f0a229f3cbb55bc3.zip |
cmd/compile/internal/types2: roll-forward removal of asX converters
This CL reverts CL 361964, rolling forward the original CL 362254 with a
fix for re-entrant expansion via type hashing (compare patchsets 1 and
2).
Change-Id: I62869e50e919f42eb8d6fef5b0d7a5ec8960bd84
Reviewed-on: https://go-review.googlesource.com/c/go/+/362118
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/types2/predicates.go')
-rw-r--r-- | src/cmd/compile/internal/types2/predicates.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/cmd/compile/internal/types2/predicates.go b/src/cmd/compile/internal/types2/predicates.go index 7fbb91eb61..8d676ed8f6 100644 --- a/src/cmd/compile/internal/types2/predicates.go +++ b/src/cmd/compile/internal/types2/predicates.go @@ -72,7 +72,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 } @@ -84,7 +84,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. |