mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-12 01:11:27 +02:00
40413: WARN_NESTED_VAR subscripted variable fix.
No warning needed on paramter that's created temporarily to help assignment.
This commit is contained in:
parent
2854a67e09
commit
b3637caa90
3 changed files with 25 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2017-01-25 Peter Stephenson <p.stephenson@samsung.com>
|
||||||
|
|
||||||
|
* 40413: Src/params.c, Test/E01options.ztst: no WARN_NESTED_VAR
|
||||||
|
warning on bogus parameter created for subscripted assignment.
|
||||||
|
|
||||||
2017-01-25 Daniel Shahaf <d.s@daniel.shahaf.name>
|
2017-01-25 Daniel Shahaf <d.s@daniel.shahaf.name>
|
||||||
|
|
||||||
* 40403/0004: Functions/VCS_Info/Backends/VCS_INFO_get_data_git,
|
* 40403/0004: Functions/VCS_Info/Backends/VCS_INFO_get_data_git,
|
||||||
|
|
|
@ -2926,7 +2926,11 @@ assignsparam(char *s, char *val, int flags)
|
||||||
unqueue_signals();
|
unqueue_signals();
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
flags &= ~ASSPM_WARN_CREATE;
|
/*
|
||||||
|
* Parameter defined here is a temporary bogus one.
|
||||||
|
* Don't warn about anything.
|
||||||
|
*/
|
||||||
|
flags &= ~ASSPM_WARN;
|
||||||
}
|
}
|
||||||
*ss = '[';
|
*ss = '[';
|
||||||
v = NULL;
|
v = NULL;
|
||||||
|
|
|
@ -1188,6 +1188,21 @@
|
||||||
?fn_wnv:20: numeric parameter foo5 set in enclosing scope in function fn_wnv
|
?fn_wnv:20: numeric parameter foo5 set in enclosing scope in function fn_wnv
|
||||||
?all off again
|
?all off again
|
||||||
|
|
||||||
|
|
||||||
|
(
|
||||||
|
setopt warnnestedvar
|
||||||
|
() {
|
||||||
|
typeset -A a
|
||||||
|
: ${a[hello world]::=foo}
|
||||||
|
print ${(t)a}
|
||||||
|
key="hello world"
|
||||||
|
print $a[$key]
|
||||||
|
}
|
||||||
|
)
|
||||||
|
0:No false positive on parameter used with subscripted assignment
|
||||||
|
>association-local
|
||||||
|
>foo
|
||||||
|
|
||||||
# This really just tests if XTRACE is egregiously broken.
|
# This really just tests if XTRACE is egregiously broken.
|
||||||
# To test it properly would need a full set of its own.
|
# To test it properly would need a full set of its own.
|
||||||
fn() { print message; }
|
fn() { print message; }
|
||||||
|
|
Loading…
Reference in a new issue