diff options
author | Robert Griesemer <gri@golang.org> | 2021-08-08 12:37:35 -0700 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2021-08-10 01:20:32 +0000 |
commit | 508624f359f168cab32814f63d29a4305fb01588 (patch) | |
tree | 7675eb28b04ed0a9cb0fc95c647eb7edbd775af7 /src/cmd/compile/internal/types2/typexpr.go | |
parent | f5f79c47f900300e8ac962e73ae7c2c706489d67 (diff) | |
download | go-508624f359f168cab32814f63d29a4305fb01588.tar.gz go-508624f359f168cab32814f63d29a4305fb01588.zip |
[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>
Diffstat (limited to 'src/cmd/compile/internal/types2/typexpr.go')
-rw-r--r-- | src/cmd/compile/internal/types2/typexpr.go | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/cmd/compile/internal/types2/typexpr.go b/src/cmd/compile/internal/types2/typexpr.go index fa4a1638b6..6a9eacd31d 100644 --- a/src/cmd/compile/internal/types2/typexpr.go +++ b/src/cmd/compile/internal/types2/typexpr.go @@ -446,8 +446,7 @@ func (check *Checker) instantiatedType(x syntax.Expr, targsx []syntax.Expr, def // make sure we check instantiation works at least once // and that the resulting type is valid check.later(func() { - t := expand(typ) - check.validType(t, nil) + check.validType(typ, nil) }) return typ |