]> Cypherpunks.ru repositories - gostls13.git/commitdiff
go/types: remove some unnecessary loading/expansion of Named types
authorRobert Findley <rfindley@google.com>
Thu, 9 Sep 2021 22:41:30 +0000 (18:41 -0400)
committerRobert Findley <rfindley@google.com>
Sun, 12 Sep 2021 16:46:58 +0000 (16:46 +0000)
For Identical an u.nify, only type arguments and pointer identity is
needed.

Change-Id: Id4018d2a53044fa20fd26d28890f28b37b6d6d70
Reviewed-on: https://go-review.googlesource.com/c/go/+/349409
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>
src/go/types/predicates.go
src/go/types/unify.go

index 73d240241e9ceb4bf0fd6763c79c884e1da8f086..9aa565b68a6f594931def8509b1d3cef3252c590 100644 (file)
@@ -302,9 +302,6 @@ func identical(x, y Type, cmpTags bool, p *ifacePair) bool {
                // Two named types are identical if their type names originate
                // in the same type declaration.
                if y, ok := y.(*Named); ok {
-                       x.expand(nil)
-                       y.expand(nil)
-
                        xargs := x.TypeArgs().list()
                        yargs := y.TypeArgs().list()
 
index ed769aafe87cc42f44ce6a5ec3e087d29798b151..6d10f71a9010ff5459a3ff300ded5931d953f038 100644 (file)
@@ -425,9 +425,6 @@ func (u *unifier) nify(x, y Type, p *ifacePair) bool {
 
        case *Named:
                if y, ok := y.(*Named); ok {
-                       x.expand(nil)
-                       y.expand(nil)
-
                        xargs := x.targs.list()
                        yargs := y.targs.list()