]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.typeparams] cmd/compile: add missing copy of Field.Embedded in type substituter.
authorDan Scales <danscales@google.com>
Sun, 13 Jun 2021 18:05:45 +0000 (11:05 -0700)
committerDan Scales <danscales@google.com>
Fri, 18 Jun 2021 16:33:06 +0000 (16:33 +0000)
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>

src/cmd/compile/internal/typecheck/subr.go

index 79b2402fe705521d6f2c0d0fad4be4121380d2f0..fb6d660db52dd5027c20bb91522e23c41a4e80d2 100644 (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
                        // the type param, not the instantiated type).
                        newfields[i] = types.NewField(f.Pos, f.Sym, t2)
+                       newfields[i].Embedded = f.Embedded
                        if f.Nname != nil && ts.Vars != nil {
                                v := ts.Vars[f.Nname.(*ir.Name)]
                                if v != nil {