bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: local -[aA] on dangling nameref


From: Grisha Levit
Subject: Re: local -[aA] on dangling nameref
Date: Fri, 24 Oct 2025 13:21:39 -0400

On Fri, Oct 24, 2025 at 9:04 AM Chet Ramey <chet.ramey@case.edu> wrote:
>
> On 10/23/25 11:08 PM, Grisha Levit wrote:
>
> > Looks like circular namerefs might need something similar as well:
> >
> >      f() {
> >          local -n x; local -p x
> >          local -A x; local -p x
> >          (local x=(z))
> >      }
> >      x=x f
> >
> >      bash: local: x: not found
> >      bash: warning: x: circular name reference
> >      bash: warning: x: circular name reference
> >      declare -Anx x=()
> >      Segmentation fault ( local x=(z) )
>
> Thanks for the report. I get
>
> ./x2: line 2: local: x: not found

BTW, this still seems incorrect, shouldn't it print `declare -n x'?

> ./x2: line 3: warning: x: circular name reference
> ./x2: line 3: warning: x: circular name reference
> declare -Ax x=()
>
> with the latest devel branch, using interactive and non-interactive shells.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]