From: Dan Scales Date: Sun, 13 Jun 2021 18:05:45 +0000 (-0700) Subject: [dev.typeparams] cmd/compile: add missing copy of Field.Embedded in type substituter. X-Git-Tag: go1.18beta1~1818^2^2~311 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=e9c01f980403ef88340ded62d78b4cd3a4b592f8;p=gostls13.git [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 TryBot-Result: Go Bot Reviewed-by: Robert Griesemer Trust: Dan Scales --- diff --git a/src/cmd/compile/internal/typecheck/subr.go b/src/cmd/compile/internal/typecheck/subr.go index 79b2402fe7..fb6d660db5 100644 --- a/src/cmd/compile/internal/typecheck/subr.go +++ b/src/cmd/compile/internal/typecheck/subr.go @@ -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 {