We were missing copying the Funarg value when substituting for a struct
type.
Change-Id: Id0c2d9e55fb15987acb9edba6f74cf57cfd3417e
Reviewed-on: https://go-review.googlesource.com/c/go/+/347913
Run-TryBot: Dan Scales <danscales@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Trust: Dan Scales <danscales@google.com>
newt = forw
}
- if !newt.HasTParam() {
+ if !newt.HasTParam() && !newt.IsFuncArgStruct() {
// Calculate the size of any new types created. These will be
// deferred until the top-level ts.Typ() or g.typ() (if this is
// called from g.fillinMethods()).
}
}
if newfields != nil {
- return types.NewStruct(t.Pkg(), newfields)
+ news := types.NewStruct(t.Pkg(), newfields)
+ news.StructType().Funarg = t.StructType().Funarg
+ return news
}
return t