Re: delcare -a on a nameref in a function modifies nameref instead of target

2018-07-26 Thread Chet Ramey
On 7/25/18 4:27 PM, Grisha Levit wrote: > In the latest devel this issue is fixed for the case that the local nameref > points to a non-existent variable but there is still a bug if the variable > pointed to by a local nameref already exists. Thanks for the report. The original fix was too conse

Re: segfault w/ localvar_inherit and associative array insert

2018-07-26 Thread Chet Ramey
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 inheri

Re: segfault w/ localvar_inherit and associative array insert

2018-07-26 Thread Grisha Levit
It seems that in general the array type is inherited just fine, there is an issue only in the case that: * the `A' attribute is inherited but not explicitly supplied * we are creating the local variable with the `declare' command (i.e. it is not already an existing local variable) * w