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

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



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



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