You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
package p
var c chan int
var x int = <-chan int(c)
produces a compiler error:
x.go:3:23: error: expected ';' or newline after top level declaration
x.go:3:5: error: incompatible type in initialization
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.