mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: consolidate Type construction and copying code
This should is preparatory cleanup to make it easier to use separate types to represent each kind of Go type, rather than a single omnibus Type struct with heavily overloaded fields. Also, add TODO comments marking assignments that change an existing Type's kind, as they need to be removed before we can factor Type. Change-Id: If4b551fdea4ae045b10b1a3de2ee98f5cf32a517 Reviewed-on: https://go-review.googlesource.com/20494 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
c2400e31ad
commit
b014b55b82
5 changed files with 39 additions and 35 deletions
|
|
@ -697,8 +697,7 @@ func arraylit(ctxt int, pass int, n *Node, var_ *Node, init *Nodes) {
|
|||
|
||||
func slicelit(ctxt int, n *Node, var_ *Node, init *Nodes) {
|
||||
// make an array type
|
||||
t := shallow(n.Type)
|
||||
|
||||
t := n.Type.Copy()
|
||||
t.Bound = Mpgetfix(n.Right.Val().U.(*Mpint))
|
||||
t.Width = 0
|
||||
t.Sym = nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue