diff options
author | Robert Griesemer <gri@golang.org> | 2021-02-19 09:39:01 -0800 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2021-02-19 19:39:03 +0000 |
commit | 6521c7b3786a69bc6ad3840ef2e3ba2088ad1cae (patch) | |
tree | 0c0f0e8a131ef6811a3baef5b5b64556638471a5 /src/cmd/compile/internal/types2/type.go | |
parent | dfe0ef961b02916ae8403ced9a9a7c9a9ec19a7e (diff) | |
download | go-6521c7b3786a69bc6ad3840ef2e3ba2088ad1cae.tar.gz go-6521c7b3786a69bc6ad3840ef2e3ba2088ad1cae.zip |
[dev.typeparams] cmd/compile/internal/types2: resolve decl cycle the same way as in go/types
Minor adjustment to match go/types more closely.
Change-Id: Id79c51f0ecd8cda0f5b68f6e961500f7f22f7115
Reviewed-on: https://go-review.googlesource.com/c/go/+/294270
Reviewed-by: Robert Findley <rfindley@google.com>
Trust: Robert Griesemer <gri@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/types2/type.go')
-rw-r--r-- | src/cmd/compile/internal/types2/type.go | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/src/cmd/compile/internal/types2/type.go b/src/cmd/compile/internal/types2/type.go index 1025c18b23..52bd99deab 100644 --- a/src/cmd/compile/internal/types2/type.go +++ b/src/cmd/compile/internal/types2/type.go @@ -881,16 +881,7 @@ func (t *top) String() string { return TypeString(t, nil) } // If it doesn't exist, the result is Typ[Invalid]. // under must only be called when a type is known // to be fully set up. -// -// under is set to underf to avoid an initialization cycle. -// TODO(gri) this doesn't happen in go/types - investigate -var under func(Type) Type - -func init() { - under = underf -} - -func underf(t Type) Type { +func under(t Type) Type { // TODO(gri) is this correct for *Sum? if n := asNamed(t); n != nil { return n.under() |