Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
go/parser: correct channel conversion is not accepted #4111
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.