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:
Matthew Dempsky 2018-04-24 13:53:35 -07:00
parent e10ee798c4
commit 2083b5d673
12 changed files with 54 additions and 63 deletions

View file

@ -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())