mirror of
https://github.com/golang/go.git
synced 2025-11-09 13:11:03 +00:00
[dev.regabi] cmd/compile: remove DeepCopyNode interface
The only reason for the DeepCopyNode interface was to allow the type syntaxes to avoid being constrained by Left, Right etc. methods. Now those are gone, so the general traversal methods they implement (doChildren, editChildren) do the right thing for DeepCopy. Passes buildall w/ toolstash -cmp. Change-Id: I54672c011114a95efabff32dbcf02e6071f91b9e Reviewed-on: https://go-review.googlesource.com/c/go/+/275379 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
parent
9ab3d854ad
commit
5dbd2e8e44
3 changed files with 0 additions and 91 deletions
|
|
@ -1163,17 +1163,6 @@ func (n *StarExpr) SetOTYPE(t *types.Type) {
|
|||
t.SetNod(n)
|
||||
}
|
||||
|
||||
func (n *StarExpr) DeepCopy(pos src.XPos) Node {
|
||||
if n.op == OTYPE {
|
||||
// Can't change types and no node references left.
|
||||
return n
|
||||
}
|
||||
c := SepCopy(n).(*StarExpr)
|
||||
c.pos = n.posOr(pos)
|
||||
c.X = DeepCopy(pos, n.X)
|
||||
return c
|
||||
}
|
||||
|
||||
// A TypeAssertionExpr is a selector expression X.(Type).
|
||||
// Before type-checking, the type is Ntype.
|
||||
type TypeAssertExpr struct {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue