Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: LOCAL_VARS option ?



Daniel Shahaf wrote on Mon, Jan 23, 2017 at 11:20:08 +0000:
> Peter Stephenson wrote on Mon, Jan 23, 2017 at 10:09:14 +0000:
> > I've committed this for further examination.
> 
> Thanks!  (not only for the patch, but also for the shiny new docstring
> it adds)
> 
> I'm tempted to add it to zsh-syntax-highlighting as:
> .
>     setopt localoptions warncreateglobal ${(k)options[(I)warnnestedvar]}
> .
> which should also work when ${options} is unset and in released shells
> that lack WARN_NESTED_VAR.

This case seems to be a false positive:

% () { typeset -A a; : ${a[hello world]::=foo} } 
(anon): scalar parameter hello world set in enclosing scope in function (anon)



Messages sorted by: Reverse Date, Date, Thread, Author