mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile/internal/types: replace Type.Val with Type.Elem
This reduces the API surface of Type slightly (for #25056), but also makes it more consistent with the reflect and go/types APIs. Passes toolstash-check. Change-Id: Ief9a8eb461ae6e88895f347e2a1b7b8a62423222 Reviewed-on: https://go-review.googlesource.com/109138 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
e10ee798c4
commit
2083b5d673
12 changed files with 54 additions and 63 deletions
|
|
@ -71,7 +71,7 @@ func typecheckrangeExpr(n *Node) {
|
|||
|
||||
case TMAP:
|
||||
t1 = t.Key()
|
||||
t2 = t.Val()
|
||||
t2 = t.Elem()
|
||||
|
||||
case TCHAN:
|
||||
if !t.ChanDir().CanRecv() {
|
||||
|
|
@ -297,7 +297,7 @@ func walkrange(n *Node) *Node {
|
|||
|
||||
fn := syslook("mapiterinit")
|
||||
|
||||
fn = substArgTypes(fn, t.Key(), t.Val(), th)
|
||||
fn = substArgTypes(fn, t.Key(), t.Elem(), th)
|
||||
init = append(init, mkcall1(fn, nil, nil, typename(t), ha, nod(OADDR, hit, nil)))
|
||||
n.Left = nod(ONE, nodSym(ODOT, hit, keysym), nodnil())
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue