From: Robert Griesemer Date: Tue, 14 Sep 2021 20:18:40 +0000 (-0700) Subject: cmd/compile/internal/types2: remove some unnecessary loading/expansion of Named types X-Git-Tag: go1.18beta1~1345 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=b26d325cb1;p=gostls13.git cmd/compile/internal/types2: remove some unnecessary loading/expansion of Named types 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 Run-TryBot: Robert Griesemer TryBot-Result: Go Bot Reviewed-by: Robert Findley --- diff --git a/src/cmd/compile/internal/types2/predicates.go b/src/cmd/compile/internal/types2/predicates.go index 473d22675f..aa797fccc7 100644 --- a/src/cmd/compile/internal/types2/predicates.go +++ b/src/cmd/compile/internal/types2/predicates.go @@ -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() diff --git a/src/cmd/compile/internal/types2/unify.go b/src/cmd/compile/internal/types2/unify.go index a1e5b3679b..bb69f0d27b 100644 --- a/src/cmd/compile/internal/types2/unify.go +++ b/src/cmd/compile/internal/types2/unify.go @@ -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()