1
0
mirror of https://github.com/golang/go synced 2024-11-22 23:50:03 -07:00

[dev.typeparams] cmd/compile: add missing copy of Field.Embedded in type substituter.

Change-Id: I876933370a6bcb6586eda9d8fc28a081bf31b1cf
Reviewed-on: https://go-review.googlesource.com/c/go/+/328511
Run-TryBot: Dan Scales <danscales@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Trust: Dan Scales <danscales@google.com>
This commit is contained in:
Dan Scales 2021-06-13 11:05:45 -07:00
parent 6fa0437958
commit e9c01f9804

View File

@ -1220,6 +1220,7 @@ func (ts *Tsubster) tstruct(t *types.Type, force bool) *types.Type {
// names of embedded types (which should keep the name of // names of embedded types (which should keep the name of
// the type param, not the instantiated type). // the type param, not the instantiated type).
newfields[i] = types.NewField(f.Pos, f.Sym, t2) newfields[i] = types.NewField(f.Pos, f.Sym, t2)
newfields[i].Embedded = f.Embedded
if f.Nname != nil && ts.Vars != nil { if f.Nname != nil && ts.Vars != nil {
v := ts.Vars[f.Nname.(*ir.Name)] v := ts.Vars[f.Nname.(*ir.Name)]
if v != nil { if v != nil {