Page 1 of 1

Bug? Using Variable name CS leads to warning

Posted: 27 Nov 2018, 07:02
by hoppfrosch
Within my class I have a method, doing something like this

Code: Select all

class X {
	;....
	methodA() {
		cs := functionXYZ()
	}
	;....
}
Using this class, I get a warning (having #warn enabled):

Code: Select all

---------------------------
test.ahk
---------------------------
Warning in #include file ".........\MyClass.ahk":
     Class may be overwritten.

Specifically: CS

	Line#
	...
	248: CounterCurr := 0
--->	250: CS := CallStack(deepness := thiscalldepth+20)
	252: Loop tokens.Length()
	....
What does this message mean? Nowhere else within my code anything is named "CS" (espacially no class named "CS")....

Renaming CS to anything else (for example cst) the code runs without this warning. Within my code cs is written in lowercase letters - whereas in the warning box it's written in uppercase ....

Is CS a special internal AHK-variable, which is not to used by user? Is this a bug in AHK?

Runnning AHK 2.0-a100-52515e2

Re: Bug? Using Variable name CS leads to warning

Posted: 30 Nov 2018, 11:40
by SL5
I dont know. it remember the word CodeSort

Re: Bug? Using Variable name CS leads to warning

Posted: 01 Dec 2018, 08:42
by Helgef
Can you provide something reproducable?

Cheers.

Re: Bug? Using Variable name CS leads to warning

Posted: 03 Dec 2018, 00:29
by hoppfrosch
Helgef wrote:
01 Dec 2018, 08:42
Can you provide something reproducable?
It's deeply embedded in my class hierarchy currently - I've got to isolate the problem. I'll give it a try as soon as I've got some spare time .... :?

Re: Bug? Using Variable name CS leads to warning

Posted: 12 May 2019, 20:17
by lexikos
It is most likely a legitimate warning. If you haven't already worked it out, you can probably verify by using ListVars inside methodA; if it has no local variable named "cs", you are definitely assigning to a super-global variable (i.e. a class).