Skip to content

Commit ad97d20

Browse files
committed
go/types: remove some unnecessary loading/expansion of Named types
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 <[email protected]> Run-TryBot: Robert Findley <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Robert Griesemer <[email protected]>
1 parent 0d8a4bf commit ad97d20

File tree

2 files changed

+0
-6
lines changed

2 files changed

+0
-6
lines changed

src/go/types/predicates.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,6 @@ func identical(x, y Type, cmpTags bool, p *ifacePair) bool {
302302
// Two named types are identical if their type names originate
303303
// in the same type declaration.
304304
if y, ok := y.(*Named); ok {
305-
x.expand(nil)
306-
y.expand(nil)
307-
308305
xargs := x.TypeArgs().list()
309306
yargs := y.TypeArgs().list()
310307

src/go/types/unify.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -425,9 +425,6 @@ func (u *unifier) nify(x, y Type, p *ifacePair) bool {
425425

426426
case *Named:
427427
if y, ok := y.(*Named); ok {
428-
x.expand(nil)
429-
y.expand(nil)
430-
431428
xargs := x.targs.list()
432429
yargs := y.targs.list()
433430

0 commit comments

Comments
 (0)