The following code generates a “use of undefined variable” warning when referencing the upvar’d array aBar.
I am running 8.5 and 9.2 side-by-side, and the problem does not exist in 8.5 - even though the warn suppress settings appear to be the same.
proc foo {upvBar} {
upvar 1 $upvBar aBar
foreach name [array names aBar] {
puts -nonewline "$name="
# The line below generates a warnUndefinedVar warning
puts $aBar($name)
}
}
set aTest(one) 1
set aTest(two) 2
set aTest(three) 3
foo aTest