Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: BUG: Assigning a string to an array via a reference fails to change its type



On Fri, Jun 13, 2025 at 3:28 AM Philippe Altherr
<philippe.altherr@xxxxxxxxx> wrote:
>
> When a string is assigned to an array variable, the variable becomes a string variable initialized with that string. When the same is done via a reference, the content of the array is replaced with the string and a debug message is emitted (when debugging is enabled).
>
> typeset -a arr=(aa bb cc)
> typeset -n ref=arr
> ref=foo
> typeset -p ref arr
> Output:
> 3: params.c:1068: BUG: local parameter is not unset
> typeset -n ref=arr
> typeset -a arr=( foo )
>
> I haven't tried to understand what/where the problem was. Neither Bart's patch to disallow array initializers nor my patch to change PM_TYPE help.
>
> Philippe
>

I reported this in zw/53751 already.

-- 
Mikael Magnusson




Messages sorted by: Reverse Date, Date, Thread, Author