[PATCH] Fix bang flag in ${(!)ref::=var} substitutions

Philippe Altherr <[email protected]> Fri, 10 Jul 2026 14:05:36 +0200
Newsgroups gmane.comp.shells.zsh.devel
Message-ID <CAGdYchtt-6ybEWH0q70maUO2D3ZfieNdVN_68-F2MVohjdk77Q@mail.gmail.com>
The documentation states that with the substitution flag (!) the reference
itself is examined, not its referent, but this fails in ${(!)ref::=var}
substitutions:

% typeset var=foo
% typeset -n ref=var
% echo ${(!)ref::=bar}
bar
% typeset -p var ref
typeset var=bar
typeset -n ref=var

The result of the last command should be the following:

typeset var=foo
typeset -n ref=bar

- Fix bang flag in ${(!)ref::=var} substitutions
<https://github.com/paltherr/zsh/compare/fix-bang-flag-in-substitutions-start...paltherr:zsh:fix-bang-flag-in-substitutions>

Philippe