]> Cypherpunks repositories - gostls13.git/commit
[dev.typeparams] cmd/compile/internal/types2: expand is only required for *Named...
authorRobert Griesemer <gri@golang.org>
Sun, 8 Aug 2021 19:37:35 +0000 (12:37 -0700)
committerRobert Griesemer <gri@golang.org>
Tue, 10 Aug 2021 01:20:32 +0000 (01:20 +0000)
commit508624f359f168cab32814f63d29a4305fb01588
tree7675eb28b04ed0a9cb0fc95c647eb7edbd775af7
parentf5f79c47f900300e8ac962e73ae7c2c706489d67
[dev.typeparams] cmd/compile/internal/types2: expand is only required for *Named types

Now that the pointer identity for a *Named type doesn't change
anymore when going from lazy instantiated to actually instantiated
(= expanded) state, expand() only needs to be called when we deal
with *Named types and only if we care about a *Named type's internals.

Remove the expand function and respective calls for all types and
replace with specific t.expand() method calls where t is a *Named.

Change-Id: If82299360d60108b00adc4013b29399aec90b940
Reviewed-on: https://go-review.googlesource.com/c/go/+/340749
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
src/cmd/compile/internal/types2/builtins.go
src/cmd/compile/internal/types2/expr.go
src/cmd/compile/internal/types2/named.go
src/cmd/compile/internal/types2/predicates.go
src/cmd/compile/internal/types2/signature.go
src/cmd/compile/internal/types2/type.go
src/cmd/compile/internal/types2/typexpr.go
src/cmd/compile/internal/types2/unify.go
src/cmd/compile/internal/types2/union.go