issues with nameref resolution loop in a function

2018-12-08 Thread Grisha Levit
There seems to be an issue with the following new bash-5.0 feature: A nameref name resolution loop in a function now resolves to a variable by that name in the global scope. [ Note: "warning: x: circular name reference" messages omitted below. ] While referencing such a nameref works as desc

Re: temp env allows variables that look like array subscripts

2018-12-08 Thread Grisha Levit
FWIW, namerefs in the temporary environment bypass the implemented checks: $ declare -n ref=var[0] $ ref=X printenv 'var[0]' X

assignment to a nameref that resolves to the temporary environment

2018-12-08 Thread Grisha Levit
When a nameref local to a higher function scope points to a variable in the temporary environment, that nameref (correctly, it seems) expands to the value of the target variable from the temporary environment. However, assignment to the nameref modifies the variable from the higher scope, bypassing

should `local' create local variables when they exist in the tempenv?

2018-12-08 Thread Grisha Levit
When a variable is present in the temporary environment and then declared local in a function, it seems to not actually make a local variable, in the sense that the variable does not show up in the output of `local', unsetting the variable reveals the variable from the higher scope rather than mark