Closed
Description
cmd/compile accepts this bit of code, while go/types and gccgo reject it as an initialization cycle ("A refers to A"):
var A = func() int {
if false {
return A
}
return 0
}()
https://play.golang.org/p/jpUoGbyJqX
Related #21750. The common issue here is probably that we're performing initialization order analysis based on the optimized/inlined functions rather than the original Go source.
/cc @griesemer