// expected: package globals are immutable outside init // // A package global may only be written by init()/__varinit. stage4's check // walked package members, so a store inside a function literal was never // visited: the same assignment compiled cleanly when wrapped in a closure. // Legacy rejects both, because the rule is a property of the store, not of // where the enclosing declaration happens to sit. package main var calls int32 func main() { f := func() (r int32) { calls = calls + 1 return calls } println(f()) }