mirror of
https://github.com/golang/go.git
synced 2025-05-08 09:03:04 +00:00
cmd/compile: rename Recv->Recvs and Recv0->Recv
Change-Id: Ice3aa807169f4fec85745a3991b1084a9f85c1b5 Reviewed-on: https://go-review.googlesource.com/20499 Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
0cff505871
commit
f91b832ab5
@ -295,7 +295,7 @@ func dowidth(t *Type) {
|
|||||||
case TFUNCARGS:
|
case TFUNCARGS:
|
||||||
t1 := t.Type
|
t1 := t.Type
|
||||||
|
|
||||||
w = widstruct(t.Type, t1.Recv(), 0, 0)
|
w = widstruct(t.Type, t1.Recvs(), 0, 0)
|
||||||
w = widstruct(t.Type, t1.Params(), w, Widthreg)
|
w = widstruct(t.Type, t1.Params(), w, Widthreg)
|
||||||
w = widstruct(t.Type, t1.Results(), w, Widthreg)
|
w = widstruct(t.Type, t1.Results(), w, Widthreg)
|
||||||
t1.Argwid = w
|
t1.Argwid = w
|
||||||
@ -618,7 +618,7 @@ func typeinit() {
|
|||||||
func Argsize(t *Type) int {
|
func Argsize(t *Type) int {
|
||||||
var w int64
|
var w int64
|
||||||
|
|
||||||
for _, p := range recvParamsResults {
|
for _, p := range recvsParamsResults {
|
||||||
for f, it := IterFields(p(t)); f != nil; f = it.Next() {
|
for f, it := IterFields(p(t)); f != nil; f = it.Next() {
|
||||||
if x := f.Width + f.Type.Width; x > w {
|
if x := f.Width + f.Type.Width; x > w {
|
||||||
w = x
|
w = x
|
||||||
|
@ -477,7 +477,7 @@ func (p *exporter) typ(t *Type) {
|
|||||||
|
|
||||||
for _, m := range methods {
|
for _, m := range methods {
|
||||||
p.string(m.Sym.Name)
|
p.string(m.Sym.Name)
|
||||||
p.paramList(m.Type.Recv())
|
p.paramList(m.Type.Recvs())
|
||||||
p.paramList(m.Type.Params())
|
p.paramList(m.Type.Params())
|
||||||
p.paramList(m.Type.Results())
|
p.paramList(m.Type.Results())
|
||||||
p.inlinedBody(m.Type.Nname)
|
p.inlinedBody(m.Type.Nname)
|
||||||
|
@ -661,7 +661,7 @@ func funcargs2(t *Type) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if t.Thistuple != 0 {
|
if t.Thistuple != 0 {
|
||||||
for ft, it := IterFields(t.Recv()); ft != nil; ft = it.Next() {
|
for ft, it := IterFields(t.Recvs()); ft != nil; ft = it.Next() {
|
||||||
if ft.Nname == nil || ft.Nname.Sym == nil {
|
if ft.Nname == nil || ft.Nname.Sym == nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
@ -1134,7 +1134,7 @@ func fakethis() *Node {
|
|||||||
// Those methods have an anonymous *struct{} as the receiver.
|
// Those methods have an anonymous *struct{} as the receiver.
|
||||||
// (See fakethis above.)
|
// (See fakethis above.)
|
||||||
func isifacemethod(f *Type) bool {
|
func isifacemethod(f *Type) bool {
|
||||||
rcvr := f.Recv0()
|
rcvr := f.Recv()
|
||||||
if rcvr.Sym != nil {
|
if rcvr.Sym != nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@ -1165,16 +1165,16 @@ func functype0(t *Type, this *Node, in, out []*Node) {
|
|||||||
if this != nil {
|
if this != nil {
|
||||||
rcvr = []*Node{this}
|
rcvr = []*Node{this}
|
||||||
}
|
}
|
||||||
*t.RecvP() = tofunargs(rcvr)
|
*t.RecvsP() = tofunargs(rcvr)
|
||||||
*t.ResultsP() = tofunargs(out)
|
*t.ResultsP() = tofunargs(out)
|
||||||
*t.ParamsP() = tofunargs(in)
|
*t.ParamsP() = tofunargs(in)
|
||||||
|
|
||||||
uniqgen++
|
uniqgen++
|
||||||
checkdupfields(t.Recv().Type, "argument")
|
checkdupfields(t.Recvs().Type, "argument")
|
||||||
checkdupfields(t.Results().Type, "argument")
|
checkdupfields(t.Results().Type, "argument")
|
||||||
checkdupfields(t.Params().Type, "argument")
|
checkdupfields(t.Params().Type, "argument")
|
||||||
|
|
||||||
if t.Recv().Broke || t.Results().Broke || t.Params().Broke {
|
if t.Recvs().Broke || t.Results().Broke || t.Params().Broke {
|
||||||
t.Broke = true
|
t.Broke = true
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1306,7 +1306,7 @@ func addmethod(sf *Sym, t *Type, local bool, nointerface bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// get parent type sym
|
// get parent type sym
|
||||||
pa := t.Recv0() // ptr to this structure
|
pa := t.Recv() // ptr to this structure
|
||||||
if pa == nil {
|
if pa == nil {
|
||||||
Yyerror("missing receiver")
|
Yyerror("missing receiver")
|
||||||
return
|
return
|
||||||
|
@ -1384,7 +1384,7 @@ func esccall(e *EscState, n *Node, up *Node) {
|
|||||||
initEscretval(e, n, fntype)
|
initEscretval(e, n, fntype)
|
||||||
// If there is a receiver, it also leaks to heap.
|
// If there is a receiver, it also leaks to heap.
|
||||||
if n.Op != OCALLFUNC {
|
if n.Op != OCALLFUNC {
|
||||||
t := fntype.Recv0()
|
t := fntype.Recv()
|
||||||
src := n.Left.Left
|
src := n.Left.Left
|
||||||
if haspointers(t.Type) {
|
if haspointers(t.Type) {
|
||||||
escassign(e, &e.theSink, src)
|
escassign(e, &e.theSink, src)
|
||||||
@ -1468,7 +1468,7 @@ func esccall(e *EscState, n *Node, up *Node) {
|
|||||||
|
|
||||||
// Receiver.
|
// Receiver.
|
||||||
if n.Op != OCALLFUNC {
|
if n.Op != OCALLFUNC {
|
||||||
t := fntype.Recv0()
|
t := fntype.Recv()
|
||||||
src := n.Left.Left
|
src := n.Left.Left
|
||||||
if haspointers(t.Type) {
|
if haspointers(t.Type) {
|
||||||
escassignfromtag(e, t.Note, nE.Escretval, src)
|
escassignfromtag(e, t.Note, nE.Escretval, src)
|
||||||
|
@ -314,10 +314,10 @@ func dumpexporttype(t *Type) {
|
|||||||
if Debug['l'] < 2 {
|
if Debug['l'] < 2 {
|
||||||
typecheckinl(f.Type.Nname)
|
typecheckinl(f.Type.Nname)
|
||||||
}
|
}
|
||||||
exportf("\tfunc (%v) %v %v { %v }\n", Tconv(f.Type.Recv0(), obj.FmtSharp), Sconv(f.Sym, obj.FmtShort|obj.FmtByte|obj.FmtSharp), Tconv(f.Type, obj.FmtShort|obj.FmtSharp), Hconv(f.Type.Nname.Func.Inl, obj.FmtSharp))
|
exportf("\tfunc (%v) %v %v { %v }\n", Tconv(f.Type.Recv(), obj.FmtSharp), Sconv(f.Sym, obj.FmtShort|obj.FmtByte|obj.FmtSharp), Tconv(f.Type, obj.FmtShort|obj.FmtSharp), Hconv(f.Type.Nname.Func.Inl, obj.FmtSharp))
|
||||||
reexportdeplist(f.Type.Nname.Func.Inl)
|
reexportdeplist(f.Type.Nname.Func.Inl)
|
||||||
} else {
|
} else {
|
||||||
exportf("\tfunc (%v) %v %v\n", Tconv(f.Type.Recv0(), obj.FmtSharp), Sconv(f.Sym, obj.FmtShort|obj.FmtByte|obj.FmtSharp), Tconv(f.Type, obj.FmtShort|obj.FmtSharp))
|
exportf("\tfunc (%v) %v %v\n", Tconv(f.Type.Recv(), obj.FmtSharp), Sconv(f.Sym, obj.FmtShort|obj.FmtByte|obj.FmtSharp), Tconv(f.Type, obj.FmtShort|obj.FmtSharp))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -615,7 +615,7 @@ func typefmt(t *Type, flag int) string {
|
|||||||
} else {
|
} else {
|
||||||
if t.Thistuple != 0 {
|
if t.Thistuple != 0 {
|
||||||
buf.WriteString("method")
|
buf.WriteString("method")
|
||||||
buf.WriteString(Tconv(t.Recv(), 0))
|
buf.WriteString(Tconv(t.Recvs(), 0))
|
||||||
buf.WriteString(" ")
|
buf.WriteString(" ")
|
||||||
}
|
}
|
||||||
buf.WriteString("func")
|
buf.WriteString("func")
|
||||||
|
@ -48,7 +48,7 @@ var inlretvars *NodeList // temp out variables
|
|||||||
func fnpkg(fn *Node) *Pkg {
|
func fnpkg(fn *Node) *Pkg {
|
||||||
if fn.Type.Thistuple != 0 {
|
if fn.Type.Thistuple != 0 {
|
||||||
// method
|
// method
|
||||||
rcvr := fn.Type.Recv0().Type
|
rcvr := fn.Type.Recv().Type
|
||||||
|
|
||||||
if Isptr[rcvr.Etype] {
|
if Isptr[rcvr.Etype] {
|
||||||
rcvr = rcvr.Type
|
rcvr = rcvr.Type
|
||||||
@ -614,7 +614,7 @@ func mkinlcall1(np **Node, fn *Node, isddd bool) {
|
|||||||
var as *Node
|
var as *Node
|
||||||
if fn.Type.Thistuple != 0 && n.Left.Op == ODOTMETH {
|
if fn.Type.Thistuple != 0 && n.Left.Op == ODOTMETH {
|
||||||
// method call with a receiver.
|
// method call with a receiver.
|
||||||
t := fn.Type.Recv0()
|
t := fn.Type.Recv()
|
||||||
|
|
||||||
if t != nil && t.Nname != nil && !isblank(t.Nname) && t.Nname.Name.Inlvar == nil {
|
if t != nil && t.Nname != nil && !isblank(t.Nname) && t.Nname.Name.Inlvar == nil {
|
||||||
Fatalf("missing inlvar for %v\n", t.Nname)
|
Fatalf("missing inlvar for %v\n", t.Nname)
|
||||||
@ -683,7 +683,7 @@ func mkinlcall1(np **Node, fn *Node, isddd bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// append receiver inlvar to LHS.
|
// append receiver inlvar to LHS.
|
||||||
t := fn.Type.Recv0()
|
t := fn.Type.Recv()
|
||||||
|
|
||||||
if t != nil && t.Nname != nil && !isblank(t.Nname) && t.Nname.Name.Inlvar == nil {
|
if t != nil && t.Nname != nil && !isblank(t.Nname) && t.Nname.Name.Inlvar == nil {
|
||||||
Fatalf("missing inlvar for %v\n", t.Nname)
|
Fatalf("missing inlvar for %v\n", t.Nname)
|
||||||
|
@ -2193,7 +2193,7 @@ func lexinit1() {
|
|||||||
out.Type.Type = Types[TSTRING]
|
out.Type.Type = Types[TSTRING]
|
||||||
out.Funarg = true
|
out.Funarg = true
|
||||||
f := typ(TFUNC)
|
f := typ(TFUNC)
|
||||||
*f.RecvP() = rcvr
|
*f.RecvsP() = rcvr
|
||||||
*f.ResultsP() = out
|
*f.ResultsP() = out
|
||||||
*f.ParamsP() = in
|
*f.ParamsP() = in
|
||||||
f.Thistuple = 1
|
f.Thistuple = 1
|
||||||
|
@ -155,7 +155,7 @@ func emitptrargsmap() {
|
|||||||
var xoffset int64
|
var xoffset int64
|
||||||
if Curfn.Type.Thistuple > 0 {
|
if Curfn.Type.Thistuple > 0 {
|
||||||
xoffset = 0
|
xoffset = 0
|
||||||
onebitwalktype1(Curfn.Type.Recv(), &xoffset, bv)
|
onebitwalktype1(Curfn.Type.Recvs(), &xoffset, bv)
|
||||||
}
|
}
|
||||||
|
|
||||||
if Curfn.Type.Intuple > 0 {
|
if Curfn.Type.Intuple > 0 {
|
||||||
|
@ -1003,7 +1003,7 @@ func onebitlivepointermap(lv *Liveness, liveout Bvec, vars []*Node, args Bvec, l
|
|||||||
// If the receiver or arguments are unnamed, they will be omitted
|
// If the receiver or arguments are unnamed, they will be omitted
|
||||||
// from the list above. Preserve those values - even though they are unused -
|
// from the list above. Preserve those values - even though they are unused -
|
||||||
// in order to keep their addresses live for use in stack traces.
|
// in order to keep their addresses live for use in stack traces.
|
||||||
thisargtype := lv.fn.Type.Recv()
|
thisargtype := lv.fn.Type.Recvs()
|
||||||
|
|
||||||
if thisargtype != nil {
|
if thisargtype != nil {
|
||||||
xoffset = 0
|
xoffset = 0
|
||||||
|
@ -306,7 +306,7 @@ func methods(t *Type) []*Sig {
|
|||||||
if f.Type.Etype != TFUNC || f.Type.Thistuple == 0 {
|
if f.Type.Etype != TFUNC || f.Type.Thistuple == 0 {
|
||||||
Fatalf("non-method on %v method %v %v\n", mt, f.Sym, f)
|
Fatalf("non-method on %v method %v %v\n", mt, f.Sym, f)
|
||||||
}
|
}
|
||||||
if f.Type.Recv0() == nil {
|
if f.Type.Recv() == nil {
|
||||||
Fatalf("receiver with no type on %v method %v %v\n", mt, f.Sym, f)
|
Fatalf("receiver with no type on %v method %v %v\n", mt, f.Sym, f)
|
||||||
}
|
}
|
||||||
if f.Nointerface {
|
if f.Nointerface {
|
||||||
@ -322,7 +322,7 @@ func methods(t *Type) []*Sig {
|
|||||||
// if pointer receiver but non-pointer t and
|
// if pointer receiver but non-pointer t and
|
||||||
// this is not an embedded pointer inside a struct,
|
// this is not an embedded pointer inside a struct,
|
||||||
// method does not apply.
|
// method does not apply.
|
||||||
this := f.Type.Recv0().Type
|
this := f.Type.Recv().Type
|
||||||
|
|
||||||
if Isptr[this.Etype] && this.Type == t {
|
if Isptr[this.Etype] && this.Type == t {
|
||||||
continue
|
continue
|
||||||
@ -1061,7 +1061,7 @@ ok:
|
|||||||
ot = dextratype(s, ot, t, 0)
|
ot = dextratype(s, ot, t, 0)
|
||||||
|
|
||||||
case TFUNC:
|
case TFUNC:
|
||||||
for t1, it := IterFields(t.Recv()); t1 != nil; t1 = it.Next() {
|
for t1, it := IterFields(t.Recvs()); t1 != nil; t1 = it.Next() {
|
||||||
dtypesym(t1.Type)
|
dtypesym(t1.Type)
|
||||||
}
|
}
|
||||||
isddd := false
|
isddd := false
|
||||||
@ -1089,7 +1089,7 @@ ok:
|
|||||||
ot = dextratype(s, ot, t, dataAdd)
|
ot = dextratype(s, ot, t, dataAdd)
|
||||||
|
|
||||||
// Array of rtype pointers follows funcType.
|
// Array of rtype pointers follows funcType.
|
||||||
for t1, it := IterFields(t.Recv()); t1 != nil; t1 = it.Next() {
|
for t1, it := IterFields(t.Recvs()); t1 != nil; t1 = it.Next() {
|
||||||
ot = dsymptr(s, ot, dtypesym(t1.Type), 0)
|
ot = dsymptr(s, ot, dtypesym(t1.Type), 0)
|
||||||
}
|
}
|
||||||
for t1, it := IterFields(t.Params()); t1 != nil; t1 = it.Next() {
|
for t1, it := IterFields(t.Params()); t1 != nil; t1 = it.Next() {
|
||||||
|
@ -758,7 +758,7 @@ func eqtype1(t1, t2 *Type, assumedEqual map[typePair]struct{}) bool {
|
|||||||
|
|
||||||
// Loop over structs: receiver, in, out.
|
// Loop over structs: receiver, in, out.
|
||||||
case TFUNC:
|
case TFUNC:
|
||||||
for _, f := range recvParamsResults {
|
for _, f := range recvsParamsResults {
|
||||||
// Loop over fields in structs, ignoring argument names.
|
// Loop over fields in structs, ignoring argument names.
|
||||||
ta, ia := IterFields(f(t1))
|
ta, ia := IterFields(f(t1))
|
||||||
tb, ib := IterFields(f(t2))
|
tb, ib := IterFields(f(t2))
|
||||||
@ -1131,7 +1131,7 @@ func substAny(tp **Type, types *[]*Type) {
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
case TFUNC:
|
case TFUNC:
|
||||||
substAny(t.RecvP(), types)
|
substAny(t.RecvsP(), types)
|
||||||
substAny(t.ParamsP(), types)
|
substAny(t.ParamsP(), types)
|
||||||
substAny(t.ResultsP(), types)
|
substAny(t.ResultsP(), types)
|
||||||
|
|
||||||
@ -1210,7 +1210,7 @@ func deep(t *Type) *Type {
|
|||||||
|
|
||||||
case TFUNC:
|
case TFUNC:
|
||||||
nt = t.Copy()
|
nt = t.Copy()
|
||||||
*nt.RecvP() = deep(t.Recv())
|
*nt.RecvsP() = deep(t.Recvs())
|
||||||
*nt.ResultsP() = deep(t.Results())
|
*nt.ResultsP() = deep(t.Results())
|
||||||
*nt.ParamsP() = deep(t.Params())
|
*nt.ParamsP() = deep(t.Params())
|
||||||
|
|
||||||
@ -1959,7 +1959,7 @@ func genwrapper(rcvr *Type, method *Type, newnam *Sym, iface int) {
|
|||||||
isddd = n.Left.Isddd
|
isddd = n.Left.Isddd
|
||||||
}
|
}
|
||||||
|
|
||||||
methodrcvr := method.Type.Recv0().Type
|
methodrcvr := method.Type.Recv().Type
|
||||||
|
|
||||||
// generate nil pointer check for better error
|
// generate nil pointer check for better error
|
||||||
if Isptr[rcvr.Etype] && rcvr.Type == methodrcvr {
|
if Isptr[rcvr.Etype] && rcvr.Type == methodrcvr {
|
||||||
@ -2148,7 +2148,7 @@ func implements(t *Type, iface *Type, m **Type, samename **Type, ptr *int) bool
|
|||||||
|
|
||||||
// if pointer receiver in method,
|
// if pointer receiver in method,
|
||||||
// the method does not exist for value types.
|
// the method does not exist for value types.
|
||||||
rcvr = tm.Type.Recv0().Type
|
rcvr = tm.Type.Recv().Type
|
||||||
|
|
||||||
if Isptr[rcvr.Etype] && !Isptr[t0.Etype] && !followptr && !isifacemethod(tm.Type) {
|
if Isptr[rcvr.Etype] && !Isptr[t0.Etype] && !followptr && !isifacemethod(tm.Type) {
|
||||||
if false && Debug['r'] != 0 {
|
if false && Debug['r'] != 0 {
|
||||||
|
@ -224,7 +224,7 @@ func (t *Type) wantEtype(et EType) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *Type) RecvP() **Type {
|
func (t *Type) RecvsP() **Type {
|
||||||
t.wantEtype(TFUNC)
|
t.wantEtype(TFUNC)
|
||||||
return &t.Type
|
return &t.Type
|
||||||
}
|
}
|
||||||
@ -239,18 +239,17 @@ func (t *Type) ResultsP() **Type {
|
|||||||
return &t.Type.Down
|
return &t.Type.Down
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *Type) Recv() *Type { return *t.RecvP() }
|
func (t *Type) Recvs() *Type { return *t.RecvsP() }
|
||||||
func (t *Type) Params() *Type { return *t.ParamsP() }
|
func (t *Type) Params() *Type { return *t.ParamsP() }
|
||||||
func (t *Type) Results() *Type { return *t.ResultsP() }
|
func (t *Type) Results() *Type { return *t.ResultsP() }
|
||||||
|
|
||||||
// TODO(mdempsky): Rename Recv to Recvs, so Recv0 can become just Recv.
|
func (t *Type) Recv() *Type { return t.Recvs().Field(0) }
|
||||||
func (t *Type) Recv0() *Type { return t.Recv().Field(0) }
|
|
||||||
|
|
||||||
// recvParamsResults stores the accessor functions for a function Type's
|
// recvsParamsResults stores the accessor functions for a function Type's
|
||||||
// receiver, parameters, and result parameters, in that order.
|
// receiver, parameters, and result parameters, in that order.
|
||||||
// It can be used to iterate over all of a function's parameter lists.
|
// It can be used to iterate over all of a function's parameter lists.
|
||||||
var recvParamsResults = [3]func(*Type) *Type{
|
var recvsParamsResults = [3]func(*Type) *Type{
|
||||||
(*Type).Recv, (*Type).Params, (*Type).Results,
|
(*Type).Recvs, (*Type).Params, (*Type).Results,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Field returns the i'th field/method of struct/interface type t.
|
// Field returns the i'th field/method of struct/interface type t.
|
||||||
@ -463,7 +462,7 @@ func (t *Type) cmp(x *Type) ssa.Cmp {
|
|||||||
return ssa.CMPeq
|
return ssa.CMPeq
|
||||||
|
|
||||||
case TFUNC:
|
case TFUNC:
|
||||||
for _, f := range recvParamsResults {
|
for _, f := range recvsParamsResults {
|
||||||
// Loop over fields in structs, ignoring argument names.
|
// Loop over fields in structs, ignoring argument names.
|
||||||
ta, ia := IterFields(f(t))
|
ta, ia := IterFields(f(t))
|
||||||
tb, ib := IterFields(f(x))
|
tb, ib := IterFields(f(x))
|
||||||
|
@ -1311,7 +1311,7 @@ OpSwitch:
|
|||||||
// information further down the call chain to know if we
|
// information further down the call chain to know if we
|
||||||
// were testing a method receiver for unexported fields.
|
// were testing a method receiver for unexported fields.
|
||||||
// It isn't necessary, so just do a sanity check.
|
// It isn't necessary, so just do a sanity check.
|
||||||
tp := t.Recv0().Type
|
tp := t.Recv().Type
|
||||||
|
|
||||||
if l.Left == nil || !Eqtype(l.Left.Type, tp) {
|
if l.Left == nil || !Eqtype(l.Left.Type, tp) {
|
||||||
Fatalf("method receiver")
|
Fatalf("method receiver")
|
||||||
@ -2430,7 +2430,7 @@ func looktypedot(n *Node, t *Type, dostrcmp int) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// disallow T.m if m requires *T receiver
|
// disallow T.m if m requires *T receiver
|
||||||
if Isptr[f2.Type.Recv0().Type.Etype] && !Isptr[t.Etype] && f2.Embedded != 2 && !isifacemethod(f2.Type) {
|
if Isptr[f2.Type.Recv().Type.Etype] && !Isptr[t.Etype] && f2.Embedded != 2 && !isifacemethod(f2.Type) {
|
||||||
Yyerror("invalid method expression %v (needs pointer receiver: (*%v).%v)", n, t, Sconv(f2.Sym, obj.FmtShort))
|
Yyerror("invalid method expression %v (needs pointer receiver: (*%v).%v)", n, t, Sconv(f2.Sym, obj.FmtShort))
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@ -2513,7 +2513,7 @@ func lookdot(n *Node, t *Type, dostrcmp int) *Type {
|
|||||||
}
|
}
|
||||||
tt := n.Left.Type
|
tt := n.Left.Type
|
||||||
dowidth(tt)
|
dowidth(tt)
|
||||||
rcvr := f2.Type.Recv0().Type
|
rcvr := f2.Type.Recv().Type
|
||||||
if !Eqtype(rcvr, tt) {
|
if !Eqtype(rcvr, tt) {
|
||||||
if rcvr.Etype == Tptr && Eqtype(rcvr.Type, tt) {
|
if rcvr.Etype == Tptr && Eqtype(rcvr.Type, tt) {
|
||||||
checklvalue(n.Left, "call pointer method on")
|
checklvalue(n.Left, "call pointer method on")
|
||||||
@ -3436,7 +3436,7 @@ func typecheckfunc(n *Node) {
|
|||||||
}
|
}
|
||||||
n.Type = t
|
n.Type = t
|
||||||
t.Nname = n.Func.Nname
|
t.Nname = n.Func.Nname
|
||||||
rcvr := t.Recv0()
|
rcvr := t.Recv()
|
||||||
if rcvr != nil && n.Func.Shortname != nil {
|
if rcvr != nil && n.Func.Shortname != nil {
|
||||||
addmethod(n.Func.Shortname.Sym, t, true, n.Func.Nname.Nointerface)
|
addmethod(n.Func.Shortname.Sym, t, true, n.Func.Nname.Nointerface)
|
||||||
}
|
}
|
||||||
|
@ -695,7 +695,7 @@ opswitch:
|
|||||||
}
|
}
|
||||||
walkexpr(&n.Left, init)
|
walkexpr(&n.Left, init)
|
||||||
walkexprlist(n.List.Slice(), init)
|
walkexprlist(n.List.Slice(), init)
|
||||||
ll := ascompatte(n.Op, n, false, t.Recv(), []*Node{n.Left.Left}, 0, init)
|
ll := ascompatte(n.Op, n, false, t.Recvs(), []*Node{n.Left.Left}, 0, init)
|
||||||
lr := ascompatte(n.Op, n, n.Isddd, t.Params(), n.List.Slice(), 0, init)
|
lr := ascompatte(n.Op, n, n.Isddd, t.Params(), n.List.Slice(), 0, init)
|
||||||
ll = append(ll, lr...)
|
ll = append(ll, lr...)
|
||||||
n.Left.Left = nil
|
n.Left.Left = nil
|
||||||
@ -2623,7 +2623,7 @@ func returnsfromheap(params *Type) []*Node {
|
|||||||
func heapmoves() {
|
func heapmoves() {
|
||||||
lno := lineno
|
lno := lineno
|
||||||
lineno = Curfn.Lineno
|
lineno = Curfn.Lineno
|
||||||
nn := paramstoheap(Curfn.Type.Recv(), false)
|
nn := paramstoheap(Curfn.Type.Recvs(), false)
|
||||||
nn = append(nn, paramstoheap(Curfn.Type.Params(), false)...)
|
nn = append(nn, paramstoheap(Curfn.Type.Params(), false)...)
|
||||||
nn = append(nn, paramstoheap(Curfn.Type.Results(), true)...)
|
nn = append(nn, paramstoheap(Curfn.Type.Results(), true)...)
|
||||||
Curfn.Func.Enter.Append(nn...)
|
Curfn.Func.Enter.Append(nn...)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user