cmd/compile: add Type.ChanDir

Generated with eg.

Passes toolstash -cmp.

Change-Id: I3af35191e73a558080f777a4eed93bcec7dfe1f5
Reviewed-on: https://go-review.googlesource.com/21469
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Josh Bleecher Snyder 2016-04-02 16:26:30 -07:00
parent 4ae4e81c2c
commit 29267c2131
7 changed files with 20 additions and 13 deletions

View file

@ -58,7 +58,7 @@ func typecheckrange(n *Node) {
t2 = t.Val()
case TCHAN:
if t.Chan&Crecv == 0 {
if t.ChanDir()&Crecv == 0 {
Yyerror("invalid operation: range %v (receive from send-only type %v)", n.Right, n.Right.Type)
goto out
}