mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: fix type substituter to copy Funarg value for structs
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>
This commit is contained in:
parent
e581ec07ee
commit
6640171914
1 changed files with 4 additions and 2 deletions
|
|
@ -1229,7 +1229,7 @@ func (ts *Tsubster) typ1(t *types.Type) *types.Type {
|
||||||
newt = forw
|
newt = forw
|
||||||
}
|
}
|
||||||
|
|
||||||
if !newt.HasTParam() {
|
if !newt.HasTParam() && !newt.IsFuncArgStruct() {
|
||||||
// Calculate the size of any new types created. These will be
|
// Calculate the size of any new types created. These will be
|
||||||
// deferred until the top-level ts.Typ() or g.typ() (if this is
|
// deferred until the top-level ts.Typ() or g.typ() (if this is
|
||||||
// called from g.fillinMethods()).
|
// called from g.fillinMethods()).
|
||||||
|
|
@ -1324,7 +1324,9 @@ func (ts *Tsubster) tstruct(t *types.Type, force bool) *types.Type {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if newfields != nil {
|
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
|
return t
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue