Bug: Unknown variable - array variables, relative namespace location
Brought to you by:
pspjuth
There appears to be a false positive being identified, for array variables that are being accessed via relative namespace paths.
If the variable is not an "array", there is no false positive.
Example code that illustrates the issue:
namespace eval ::a {
namespace eval b {
# declare/set variables
array set c [list]
variable d
set e ""
}
proc testVars {} {
# absolute namespace - identified as OK
puts [array names ::a::b::c]
# relative namespace - identified as problem
puts [array names b::c]
# basic stuff identified as OK
puts $b::c
puts $b::d
puts $b::e
}
}
a::testVars
# This is identified as OK
puts [array names ::a::b::c]
# This is not identified as OK
puts [array names a::b::c]
# These are OK
puts $::a::b::d
puts $a::b::d
I do not think it is array per se, but checks done by syntax token "v", which "array names" uses.
The checks should bail out for complex cases like this and just be quiet.