mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.typeparams] cmd/compile: set sym.Def to ir.Name for method value wrappers
The code for generating method value wrappers is weird that it sets sym.Def to the generated ir.Func, whereas normally sym.Def points to ir.Name. While here, change methodValueWrapper to return the ir.Name too, since that's what the caller wants. Change-Id: I3da5320ca0bf4d32d7b420345454f19075d19a26 Reviewed-on: https://go-review.googlesource.com/c/go/+/339410 Trust: Matthew Dempsky <mdempsky@google.com> Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
This commit is contained in:
parent
656f0888b7
commit
fe73f28dc5
2 changed files with 7 additions and 7 deletions
|
|
@ -2253,7 +2253,7 @@ func (r *reader) methodValueWrapper(tbase *types.Type, method *types.Field, targ
|
|||
pos := base.AutogeneratedPos
|
||||
|
||||
fn := r.newWrapperFunc(pos, sym, nil, method)
|
||||
sym.Def = fn
|
||||
sym.Def = fn.Nname
|
||||
|
||||
// Declare and initialize variable holding receiver.
|
||||
recv := ir.NewHiddenParam(pos, fn, typecheck.Lookup(".this"), recvType)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue