On Thu, Mar 14, 2024 at 08:29:47AM -0400, Zachary Santer wrote: > Alright, that's all fair. But this? > > On Sun, Mar 10, 2024 at 7:29 PM Zachary Santer <zsan...@gmail.com> wrote: > > > > Additionally, a nameref variable referencing a variable declared in a > > calling function hides that variable in the scope of the function where the > > nameref variable is declared. >
I don't quite understand what this is saying. Do the variables have different names, or the same name? If they have different names, then the nameref shouldn't "hide" the other variable. But they can't have the same name, because a nameref pointing to itself is a circular reference and won't ever work under any circumstance. hobbit:~$ f() { local -n var=var; var=1; }; f bash: local: warning: var: circular name reference bash: warning: var: circular name reference bash: warning: var: circular name reference You don't even need an outer calling function to see this.