"local -g" declaration references local var in enclosing scope

2024-03-10 Thread Adrian Ho
[Apologies, an earlier edition of this bug report was sent from the address a...@lex.03s.net, which can only be replied to from my internal network. Please ignore that report. Thanks much!] Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler:

Re: "local -g" declaration references local var in enclosing scope

2024-03-11 Thread Adrian Ho
Thanks much for all the insights, everyone! Indeed, the man page isn't clear on how to reason about `local -g`. I'm now left with the following understanding: 1. There is *nothing local* about `local -g`; it operates entirely at the global level. In particular, it does *not* create a local referen