Warning: This local variable has the same name as a global variable.
Specifically: base
Right now I get a TON of these warnings as I have created a collection of objects, most of which inherit from a common base object... no, it isn't named "base", I learned that lesson already lol... and then use 'base' to forward __New and __Delete calls.
However, it seems there is an issue somewhere with 'base' and this warning. Take the following simple code, for example:
Code: Select all
#NoEnv
#Warn LocalSameAsGlobal, StdOut
Class One {
__New() {
OutputDebug % "New One"
}
}
Class Two extends One {
_error := 0
__New() {
local test
OutputDebug % "New Two"
base.__New()
}
}
test := new Two()
WarnTest.ahk (11) : ==> Warning: This local variable has the same name as a global variable.
Specifically: base (in function Two.__Init)
However, if the '_error := 0' line is commented out and then the script run again the warning will not be emitted. It appears the issue is when the instance variables are being defined in the default __Init function... so how can I fix this issue?
Is there some way to have the #LocalSameAsGlobal warning system ignore 'base', or is there a way I can fix this issue without just disabling the entire warning altogether?
I did search Google and the forums for "LocalSameAsGlobal base" but didn't really find anything that helped... thanks for any insights!
~Eidola