1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-23 16:40:24 +02:00

36651: WARN_CREATE_GLOBAL += math expressions

Without this, '() { (( x=42 )) }' and '() { for (( i=0; … )) }' wouldn't warn
about $x and $i, respectively, being created global.
This commit is contained in:
Daniel Shahaf 2015-09-26 01:59:48 +00:00
parent 36abe20c0f
commit 2654cb43f6
5 changed files with 38 additions and 2 deletions

View file

@ -1110,11 +1110,15 @@
foo3=bar6
}
foo4=bar7 =true
(( foo5=8 ))
integer foo6=9
(( foo6=10 ))
}
fn
0:WARN_CREATE_GLOBAL option
?fn:3: scalar parameter foo1 created globally in function
?fn:5: scalar parameter foo1 created globally in function
?fn:15: math parameter foo5 created globally in function fn
# This really just tests if XTRACE is egregiously broken.
# To test it properly would need a full set of its own.