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

go/parser: correct channel conversion is not accepted #4111

Closed
griesemer opened this issue Sep 19, 2012 · 1 comment
Closed

go/parser: correct channel conversion is not accepted #4111

griesemer opened this issue Sep 19, 2012 · 1 comment

Comments

@griesemer
Copy link
Contributor

package p
var c chan int
var x int = <-chan int(c)

produces a syntax error:

x.go:3:13: expected expression

but it should be interpreted as:

package p
var c chan int
var x int = <-(chan int)(c)

According to the spec, <-chan int(c) is not a conversion (
http://tip.golang.org/ref/spec#Conversions ); this is even true under consideration of
issue #4109 (documentation error in the spec).

The gc compiler accepts this code.
@griesemer
Copy link
Contributor Author

Comment 1:

This issue was closed by revision 05dc3bf.

Status changed to Fixed.

@griesemer griesemer self-assigned this Oct 3, 2012
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants