diff options
| author | Robert Findley <rfindley@google.com> | 2021-09-02 10:36:37 -0400 |
|---|---|---|
| committer | Robert Findley <rfindley@google.com> | 2021-09-02 16:26:26 +0000 |
| commit | 08588e60362bbd2f71235ed8e6d2a55bb42908fa (patch) | |
| tree | d0cb6336402f2bdf089710fef02f9f10a32bf519 /src | |
| parent | d01388b04f391ac0c9872729920ebbdb0e4e6861 (diff) | |
| download | go-08588e60362bbd2f71235ed8e6d2a55bb42908fa.tar.xz | |
go/internal/gcimporter: always call SetTParams, even if empty
This resolves an outstanding TODO to be consistent about calling
SetTParams.
Done in both go/internal/gcimporter and cmd/compile/internal/importer.
Change-Id: Ief642efe016f02bab1bab960f6731a0ac0a8ad28
Reviewed-on: https://go-review.googlesource.com/c/go/+/347389
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Diffstat (limited to 'src')
| -rw-r--r-- | src/cmd/compile/internal/importer/iimport.go | 4 | ||||
| -rw-r--r-- | src/go/internal/gcimporter/iimport.go | 5 |
2 files changed, 2 insertions, 7 deletions
diff --git a/src/cmd/compile/internal/importer/iimport.go b/src/cmd/compile/internal/importer/iimport.go index c303126ea6..38cb8db235 100644 --- a/src/cmd/compile/internal/importer/iimport.go +++ b/src/cmd/compile/internal/importer/iimport.go @@ -327,9 +327,7 @@ func (r *importReader) obj(name string) { // declaration before recursing. obj := types2.NewTypeName(pos, r.currPkg, name, nil) named := types2.NewNamed(obj, nil, nil) - if tag == 'U' { - named.SetTParams(tparams) - } + named.SetTParams(tparams) r.declare(obj) underlying := r.p.typAt(r.uint64(), named).Underlying() diff --git a/src/go/internal/gcimporter/iimport.go b/src/go/internal/gcimporter/iimport.go index 444cf3b0d4..3571941d04 100644 --- a/src/go/internal/gcimporter/iimport.go +++ b/src/go/internal/gcimporter/iimport.go @@ -317,10 +317,7 @@ func (r *importReader) obj(name string) { // declaration before recursing. obj := types.NewTypeName(pos, r.currPkg, name, nil) named := types.NewNamed(obj, nil, nil) - // TODO(rfindley): guarding on tag == 'U' should not be necessary here. - if tag == 'U' { - named.SetTParams(tparams) - } + named.SetTParams(tparams) r.declare(obj) underlying := r.p.typAt(r.uint64(), named).Underlying() |
