]> Cypherpunks.ru repositories - gostls13.git/commitdiff
cmd/compile/internal/types2: remove some unnecessary loading/expansion of Named types
authorRobert Griesemer <gri@golang.org>
Tue, 14 Sep 2021 20:18:40 +0000 (13:18 -0700)
committerRobert Griesemer <gri@golang.org>
Wed, 15 Sep 2021 03:29:41 +0000 (03:29 +0000)
This is a clean port of CL 349409 from go/types to types2.

Change-Id: I2deb9ce46e6dcda736fda2169912c02163930d7d
Reviewed-on: https://go-review.googlesource.com/c/go/+/349991
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
src/cmd/compile/internal/types2/predicates.go
src/cmd/compile/internal/types2/unify.go

index 473d22675f03e772267bbf43e4d9ec7e59b47133..aa797fccc70476bb449ab0e77a480578f3e8cf5f 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 a1e5b3679bff17a47037d1a2abf1dad295ef0d1e..bb69f0d27bc13baa4e83f0ffbba5658dcd6bc7c2 100644 (file)
@@ -428,9 +428,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()