1
0
mirror of https://github.com/golang/go synced 2024-11-26 04:07:59 -07:00

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>
This commit is contained in:
Robert Findley 2021-09-02 10:36:37 -04:00
parent d01388b04f
commit 08588e6036
2 changed files with 2 additions and 7 deletions

View File

@ -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()

View File

@ -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()