about 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 20:07:51 +0000
committerPeter Stephenson <p.w.stephenson@ntlworld.com>2017-01-26 20:07:51 +0000
commit1633b2800d3679e3b89a34bcafa03956ed310b61 (patch)
tree659a062a025de5c72af269f3e86d9a8015afeab4 /Test/E01options.ztst
parent80e47a9a5d0db57dfbf90af6d2b892c8a1b0d36b (diff)
downloadzsh-1633b2800d3679e3b89a34bcafa03956ed310b61.tar.gz
zsh-1633b2800d3679e3b89a34bcafa03956ed310b61.tar.xz
zsh-1633b2800d3679e3b89a34bcafa03956ed310b61.zip
40423: WARN_NESTED_VARS, conversion the other way
Diffstat (limited to 'Test/E01options.ztst')
-rw-r--r--Test/E01options.ztst14
1 files changed, 13 insertions, 1 deletions
diff --git a/Test/E01options.ztst b/Test/E01options.ztst
index c265d78d8..343d5a9c1 100644
--- a/Test/E01options.ztst
+++ b/Test/E01options.ztst
@@ -1211,10 +1211,22 @@
       print $var
     }
   )
-0:Warn when changing type of nested variable.
+0:Warn when changing type of nested variable: array to scalar.
 ?(anon): scalar parameter var set in enclosing scope in function (anon)
 >three
 
+  (
+    setopt warnnestedvar
+    () {
+      local var=three
+      () { var=(one two); }
+      print $var
+    }
+  )
+0:Warn when changing type of nested variable: scalar to array.
+?(anon): array parameter var set in enclosing scope in function (anon)
+>one two
+
 # This really just tests if XTRACE is egregiously broken.
 # To test it properly would need a full set of its own.
   fn() { print message; }