From 80e47a9a5d0db57dfbf90af6d2b892c8a1b0d36b Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Thu, 26 Jan 2017 19:58:01 +0000 Subject: 40422: More WARN_NESTED_VAR cases. Converting type when using a calling scope was broken in the original patch. --- Test/E01options.ztst | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'Test') 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; } -- cgit 1.4.1