[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: segfault w/ localvar_inherit and associative array insert
From: |
Chet Ramey |
Subject: |
Re: segfault w/ localvar_inherit and associative array insert |
Date: |
Thu, 26 Jul 2018 10:37:16 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 |
On 7/25/18 5:37 PM, Grisha Levit wrote:
> shopt -s localvar_inherit
> declare -A var
> f() { declare var+=([0]=X); }; f
This should be an error due to mismatched array types. The local variable
is an indexed array; the global variable is an associative array (though
it is unset). You can't inherit that value.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/
Re: segfault w/ localvar_inherit and associative array insert, Chet Ramey, 2018/07/30