summary refs log tree commit diff
path: root/Test/E01options.ztst
diff options
context:
space:
mode:
authorPeter Stephenson <p.w.stephenson@ntlworld.com>2017-01-26 19:58:01 +0000
committerPeter Stephenson <p.w.stephenson@ntlworld.com>2017-01-26 19:58:17 +0000
commit80e47a9a5d0db57dfbf90af6d2b892c8a1b0d36b (patch)
treeb84f0cd8b51e744134e82cd2a0bbb4cbe10c098a /Test/E01options.ztst
parentb3637caa90e30a630fb7e677c54d5f0a1b27985d (diff)
downloadzsh-80e47a9a5d0db57dfbf90af6d2b892c8a1b0d36b.tar.gz
zsh-80e47a9a5d0db57dfbf90af6d2b892c8a1b0d36b.tar.xz
zsh-80e47a9a5d0db57dfbf90af6d2b892c8a1b0d36b.zip
40422: More WARN_NESTED_VAR cases.
Converting type when using a calling scope was broken in the
original patch.
Diffstat (limited to 'Test/E01options.ztst')
-rw-r--r--Test/E01options.ztst12
1 files changed, 12 insertions, 0 deletions
diff --git a/Test/E01options.ztst b/Test/E01options.ztst
index fd3263a8f..c265d78d8 100644
--- a/Test/E01options.ztst
+++ b/Test/E01options.ztst
@@ -1203,6 +1203,18 @@
 >association-local
 >foo
 
+  (
+    setopt warnnestedvar
+    () {
+      local var=(one two)
+      () { var=three; }
+      print $var
+    }
+  )
+0:Warn when changing type of nested variable.
+?(anon): scalar parameter var set in enclosing scope in function (anon)
+>three
+
 # This really just tests if XTRACE is egregiously broken.
 # To test it properly would need a full set of its own.
   fn() { print message; }