On 8/6/18 10:13 PM, Grisha Levit wrote:
> A few more problematic test cases in this vein (tested against latest
> devel snapshot 20180803).
Thanks for the report. These are all the same issue, with the same fix.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
A few more problematic test cases in this vein (tested against latest
devel snapshot 20180803).
f() { local -n ref=var; local -A ref=([1]=); ref=([2]=); declare -p ref var; }
unset ref var; f
# declare -An ref=()
# declare -A var=([1]="" )
declare -p ref
# declare -a ref=([2]="")
unset ref; var=
On 7/29/18 4:04 PM, Grisha Levit wrote:
> I think there's a related regression in the latest devel commit. Creating a
> local variable with the same name as a higher-scoped nameref pointing to an
> unset variable creates a local variable with the name of the target of the
> nameref.
I think forcin
I think there's a related regression in the latest devel commit. Creating a
local variable with the same name as a higher-scoped nameref pointing to an
unset variable creates a local variable with the name of the target of the
nameref.
Starting with:
declare -n ref=var
f() { local ref=Y;
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
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. In such a case, `declare'
commands after the initial `declare -n' end up modifying the value and/or
a
On Wed, Jul 18, 2018 at 8:23 AM Greg Wooledge wrote:
> FYI that one is already fixed in 5.0-alpha:
>
> wooledg:~$ declare -n ref=var; declare -a ref=(X); declare -p ref var
> declare -n ref="var"
> declare -a var=([0]="X")
> wooledg:~$ f() { declare -n ref=var; declare ref=(X); declare -p ref var;
On Tue, Jul 17, 2018 at 05:47:20PM -0400, Grisha Levit wrote:
> At global scope this works as expected:
>
> $ declare -n ref=var; declare -a ref=(X); declare -p ref var
> declare -n ref="var"
> declare -a var=([0]="X")
>
> But in a function, we end up with the nameref variable having both the
> `
At global scope this works as expected:
$ declare -n ref=var; declare -a ref=(X); declare -p ref var
declare -n ref="var"
declare -a var=([0]="X")
But in a function, we end up with the nameref variable having both the
`a' and `n' attributes and nothing in the target:
$ f() { declare -n ref=var;