While a compound assignment to a dangling nameref removes the
nameref attribute:

    $ f() { local -n x; x=(); local -p; }; f
    bash: warning: x: removing nameref attribute
    declare -a x=()

the same does not happen when using `local' to perform compound
assignment or to set the array or assoc attribute on a dangling
nameref:

    f() {
        local -n x; local -p
        local -A x; local -p
        local x=(); local -p
        local x=(y)
    }; (f)

    declare -n x
    declare -An x
    declare -aAn x=()
    Segmentation fault     ( f )

Reply via email to