aboutsummaryrefslogtreecommitdiff
path: root/test/named1.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2011-03-11 14:47:44 -0500
committerRuss Cox <rsc@golang.org>2011-03-11 14:47:44 -0500
commit3f915f51a8d16e97ac631dfb4dd5946ca675a2b8 (patch)
tree296090b5a1d922cdddce36fc4160f8d411b57f50 /test/named1.go
parent8bf34e335686816f7fe7e28614b2c7a3e04e9e7c (diff)
downloadgo-3f915f51a8d16e97ac631dfb4dd5946ca675a2b8.tar.gz
go-3f915f51a8d16e97ac631dfb4dd5946ca675a2b8.zip
go code: replace closed(c) with x, ok := <-c
R=golang-dev, rog, bradfitzwork, r CC=golang-dev https://golang.org/cl/4243072
Diffstat (limited to 'test/named1.go')
-rw-r--r--test/named1.go9
1 files changed, 3 insertions, 6 deletions
diff --git a/test/named1.go b/test/named1.go
index 1776313f05..7e7aab9c1d 100644
--- a/test/named1.go
+++ b/test/named1.go
@@ -43,10 +43,6 @@ func main() {
_, b = m[2] // ERROR "cannot .* bool.*type Bool"
m[2] = 1, b // ERROR "cannot use.*type Bool.*as type bool"
- ////TODO(rsc): uncomment when this syntax is valid for receive+check closed
- //// _, b = <-c // ERROR "cannot .* bool.*type Bool"
- //// _ = b
-
var inter interface{}
_, b = inter.(Map) // ERROR "cannot .* bool.*type Bool"
_ = b
@@ -57,8 +53,9 @@ func main() {
_, b = minter.(Map) // ERROR "cannot .* bool.*type Bool"
_ = b
- asBool(closed(c)) // ERROR "cannot use.*type bool.*as type Bool"
- b = closed(c) // ERROR "cannot use.*type bool.*type Bool"
+ _, bb := <-c
+ asBool(bb) // ERROR "cannot use.*type bool.*as type Bool"
+ _, b = <-c // ERROR "cannot .* bool.*type Bool"
_ = b
asString(String(slice)) // ERROR "cannot .*type Slice.*type String"