mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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:
parent
4ae4e81c2c
commit
29267c2131
7 changed files with 20 additions and 13 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue