diff options
| author | Russ Cox <rsc@golang.org> | 2010-01-26 10:40:28 -0800 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2010-01-26 10:40:28 -0800 |
| commit | 7abb4b3a96e240950df0bbbb30df8224be0baac6 (patch) | |
| tree | 6bcd94f21dbe50e1645428bcc3121a1ced7c4168 /test/bugs | |
| parent | 46871692c2ec86880fc6052451876cb84b9aa57c (diff) | |
| download | go-7abb4b3a96e240950df0bbbb30df8224be0baac6.tar.xz | |
gc: fix chan <- chan precedence.
also allow func() func().
R=ken2
CC=golang-dev
https://golang.org/cl/194078
Diffstat (limited to 'test/bugs')
| -rw-r--r-- | test/bugs/bug249.go | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/test/bugs/bug249.go b/test/bugs/bug249.go deleted file mode 100644 index 642170d072..0000000000 --- a/test/bugs/bug249.go +++ /dev/null @@ -1,39 +0,0 @@ -// errchk $G $D/$F.go - -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package main - -var c1 chan<- chan int -var c2 chan<- (chan int) // same type as c1 according to gccgo, gofmt -var c3 chan (<-chan int) // same type as c1 according to 6g - -func main() { - c1 = c2 // this should be ok, bug 6g doesn't accept it - c1 = c3 // ERROR "chan" -} - -/* -Channel types are parsed differently by 6g then by gccgo and gofmt. -The channel type specification ( http://golang.org/doc/go_spec.html#Channel_types ) -says that a channel type is either - - chan ElementType - chan <- ElementType - <-chan ElementType - -which indicates that the <- binds to the chan token (not to the ElementType). -So: - -chan <- chan int - -should be parsed as - -chan<- (chan int) - -Both gccgo and gofmt adhere to this, while 6g parses this as - -chan (<-chan int) -*/ |
