cmd/compile: encapsulate Type.Nname

Generated by eg, manually fixed up.

I’m not thrilled about having a setter,
but given the variety of contexts in which this
gets fiddled with, it is the cleanest
available alternative.

Change-Id: Ibdf23e638fe0bdabded014c9e59d557fab8c955f
Reviewed-on: https://go-review.googlesource.com/21341
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
Josh Bleecher Snyder 2016-03-30 16:59:53 -07:00
parent 139891e815
commit b83618f964
10 changed files with 40 additions and 23 deletions

View file

@ -45,7 +45,7 @@ func init1(n *Node, out *[]*Node) {
if n.Left != nil && n.Type != nil && n.Left.Op == OTYPE && n.Class == PFUNC {
// Methods called as Type.Method(receiver, ...).
// Definitions for method expressions are stored in type->nname.
init1(n.Type.Nname, out)
init1(n.Type.Nname(), out)
}
if n.Op != ONAME {
@ -216,7 +216,7 @@ func init2(n *Node, out *[]*Node) {
init2list(n.Func.Closure.Nbody, out)
}
if n.Op == ODOTMETH || n.Op == OCALLPART {
init2(n.Type.Nname, out)
init2(n.Type.Nname(), out)
}
}