Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: Simplify resolve_nameref and setscope
- X-seq: zsh-workers 53748
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Philippe Altherr <philippe.altherr@xxxxxxxxx>
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: PATCH: Simplify resolve_nameref and setscope
- Date: Sun, 8 Jun 2025 15:37:08 -0700
- Archived-at: <https://zsh.org/workers/53748>
- In-reply-to: <CAH+w=7YxAE=K_DRuXiyHQ0HjrvpZyeM=M2b07RB5OFz_085ukQ@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAGdYchtw_fUP16UwRTnzMWRcA4XbSq4VzN_QawjRgeM0Pmqkqg@mail.gmail.com> <CAH+w=7YxAE=K_DRuXiyHQ0HjrvpZyeM=M2b07RB5OFz_085ukQ@mail.gmail.com>
On Sun, Jun 8, 2025 at 11:12 AM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> There are some mechanical problems with this patch:
> - It omits a change on line 3132 of builtin.c (arguments to resolve_nameref).
((pm = (Param)paramtab->getnode(realparamtab, asg->value.scalar))
I think this should either be
((pm = (Param)paramtab->getnode(paramtab, asg->value.scalar))
or just a call to getparamnode() [which it can't be because that's
static to params.c]
In any case if I fix builtin.c:3132 and run "make check", I get
+ params.c:1076: BUG: local parameter is not unset
inner: foo: attempt to assign array value to non-array
Test ./K01nameref.ztst failed: error output differs from expected as
shown above for:
(
inner() { local -n var="${1:?}"; var=(alpha beta gamma); }
outer() { local foo=outer; inner foo; typeset -p foo; }
foo=3 ; { outer foo } always { typeset -p foo }
)
Was testing: up-reference part 11, assignment to enclosing scope, type mismatch
Messages sorted by:
Reverse Date,
Date,
Thread,
Author