Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/compile: channel element type too large compiling errors are not reported for channels named with blank identifer #20027

Open
go101 opened this issue Apr 18, 2017 · 6 comments
Labels
NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@go101
Copy link

go101 commented Apr 18, 2017

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

@bradfitz
Copy link
Contributor

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.

@bradfitz bradfitz added the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Apr 18, 2017
@bradfitz bradfitz added this to the Unplanned milestone Apr 18, 2017
@griesemer
Copy link
Contributor

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?

@rsc
Copy link
Contributor

rsc commented Jun 5, 2017

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.

@rsc rsc added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. labels Jun 5, 2017
@go101
Copy link
Author

go101 commented May 31, 2018

@ianlancetaylor
looks gccgo compiles this program, but the output program panics

fatal error: makechan: invalid channel element type

@go101
Copy link
Author

go101 commented Oct 19, 2020

It looks this bug has already been fixed. So anyone can verify it and close this issue now.

@go101
Copy link
Author

go101 commented Oct 19, 2020

Though there is still a small problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants