about summary refs log tree commit diff
path: root/Test
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2017-01-25 09:35:30 +0000
committerPeter Stephenson <pws@zsh.org>2017-01-25 09:35:30 +0000
commitb3637caa90e30a630fb7e677c54d5f0a1b27985d (patch)
tree6c3cb661e0fe6c22e7105254ea02b3e62661b3b9 /Test
parent2854a67e09748a2e6f4e1d8a73bc463bad4cbd4e (diff)
downloadzsh-b3637caa90e30a630fb7e677c54d5f0a1b27985d.tar.gz
zsh-b3637caa90e30a630fb7e677c54d5f0a1b27985d.tar.xz
zsh-b3637caa90e30a630fb7e677c54d5f0a1b27985d.zip
40413: WARN_NESTED_VAR subscripted variable fix.
No warning needed on paramter that's created temporarily to
help assignment.
Diffstat (limited to 'Test')
-rw-r--r--Test/E01options.ztst15
1 files changed, 15 insertions, 0 deletions
diff --git a/Test/E01options.ztst b/Test/E01options.ztst
index bcd89f787..fd3263a8f 100644
--- a/Test/E01options.ztst
+++ b/Test/E01options.ztst
@@ -1188,6 +1188,21 @@
 ?fn_wnv:20: numeric parameter foo5 set in enclosing scope in function fn_wnv
 ?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.
 # To test it properly would need a full set of its own.
   fn() { print message; }