blob: 7b07b773d4bb118bcc054e92c2f6170b15008350 [file] [log] [blame]
Russ Cox2b1c9b42012-02-16 23:49:30 -05001// compile
Rob Pike27e43082008-07-15 10:27:05 -07002
3// Copyright 2009 The Go Authors. All rights reserved.
4// Use of this source code is governed by a BSD-style
5// license that can be found in the LICENSE file.
6
7package main
8
Russ Coxf4e76d82011-01-31 18:36:28 -05009func main() {
Robert Hencke169e6d42011-03-22 10:32:43 -070010 c := make(chan int);
11 ok := false;
12 var i int;
13
14 i, ok = <-c; // works
15 _, _ = i, ok;
16
17 ca := new([2]chan int);
18 i, ok = <-(ca[0]); // fails: c.go:11: bad shape across assignment - cr=1 cl=2
19 _, _ = i, ok;
Rob Pike27e43082008-07-15 10:27:05 -070020}