Bug? Using Variable name CS leads to warning

Discuss the future of the AutoHotkey language
User avatar
hoppfrosch
Posts: 374
Joined: 07 Oct 2013, 04:05
GitHub: hoppfrosch
Location: Rhine-Maine-Area, Hesse, Germany
Contact:

Bug? Using Variable name CS leads to warning

27 Nov 2018, 07:02

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
User avatar
SL5
Posts: 861
Joined: 12 May 2015, 02:10
GitHub: sl5net
Contact:

Re: Bug? Using Variable name CS leads to warning

30 Nov 2018, 11:40

I dont know. it remember the word CodeSort
Helgef
Posts: 3987
Joined: 17 Jul 2016, 01:02
Contact:

Re: Bug? Using Variable name CS leads to warning

01 Dec 2018, 08:42

Can you provide something reproducable?

Cheers.
User avatar
hoppfrosch
Posts: 374
Joined: 07 Oct 2013, 04:05
GitHub: hoppfrosch
Location: Rhine-Maine-Area, Hesse, Germany
Contact:

Re: Bug? Using Variable name CS leads to warning

03 Dec 2018, 00:29

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 .... :?
lexikos
Posts: 6652
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: Bug? Using Variable name CS leads to warning

12 May 2019, 20:17

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).

Return to “AutoHotkey v2 Development”

Who is online

Users browsing this forum: No registered users and 2 guests