Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version
)?
go version go1.8.1 linux/amd64
What did you do?
// the two are ok
var _ chan [0x2FFFF]byte
var _ = make(chan [0x2FFFF]byte)
// the two: <unknown line number>: channel element type too large (>64kB)
var c1 chan [0x2FFFF]byte
var c2 = make(chan [0x2FFFF]byte)
What did you expect to see?
compiles error for the blank identifier lines
What did you see instead?
the blank identifier lines compile ok
Comment From: bradfitz
Why? Seems fine to me. You can't use those channels anyway, so no need reporting an unnecessary error. The errors on the named channels are because the implementation isn't able to handle them.
Comment From: griesemer
I don't think this is a bug, but I can see arguments both ways (and also compilers which might complain in both cases). @mdempsky, any thoughts?
Comment From: rsc
I could see an argument for not giving an error for the plain declaration, but if the make would fail to compile when assigned to c2, I don't see any argument for compiling successfully when assigned to _. Blank assignments are supposed to have all the side effects of evaluation of the rhs.
The _ assignments and c1, c2 assignments should behave the same. They do in go/types (accepts both), and here the compiler should probably reject both.
Comment From: zigo101
@ianlancetaylor looks gccgo compiles this program, but the output program panics
fatal error: makechan: invalid channel element type
Comment From: zigo101
It looks this bug has already been fixed. So anyone can verify it and close this issue now.
Comment From: zigo101
Though there is still a small problem.
Comment From: gopherbot
Change https://go.dev/cl/612618 mentions this issue: all: add test for issue 20027