[progress]In a meaningless case, crash when load

Report problems with documented functionality
User avatar
RobertL
Posts: 546
Joined: 18 Jan 2014, 01:14
Location: China

[progress]In a meaningless case, crash when load

11 Oct 2014, 22:16

Code: Select all

class b{
	static k:={s:1}
}
class o extends b.k{
}
Msgbox % o.s
AHK V1 V2, XP SP3
Last edited by RobertL on 12 Oct 2014, 19:48, edited 1 time in total.
我为人人,人人为己?
lexikos
Posts: 9592
Joined: 30 Sep 2013, 04:07
Contact:

Re: In a meaningless case, crash when load

12 Oct 2014, 06:28

Interesting. In case you weren't aware, the expected behaviour in this case is an "Unknown class" error message. "BaseClassName must be the full name of another class". I will be sure to look into why it crashes.
User avatar
RobertL
Posts: 546
Joined: 18 Jan 2014, 01:14
Location: China

Re: lexikos

12 Oct 2014, 09:12

Have never seen: "Unknown class", "BaseClassName must be the full name of another class".
full name of another clas mean this?

Code: Select all

class b{
    static k:={s:1,__Class:"b.k"}	;Add '__Class'
}
class o extends b.k{
}
Msgbox % o.s
Thanks.
我为人人,人人为己?
lexikos
Posts: 9592
Joined: 30 Sep 2013, 04:07
Contact:

Re: In a meaningless case, crash when load

12 Oct 2014, 16:21

No. This is a class:

Code: Select all

class b{
    ;...
}
This is a static variable initializer:

Code: Select all

static k:={s:1,__Class:"b.k"}
b.k is a static variable, not a class. Furthermore, static initializers are evaluated after the script starts running. Class definitions are processed before that, when b.k is uninitialized.
User avatar
RobertL
Posts: 546
Joined: 18 Jan 2014, 01:14
Location: China

Re: lexikos

12 Oct 2014, 19:47

Eh.. I see, class definitions then static initializers. Class is an object in essence, but with difference procedure.
Thanks.
我为人人,人人为己?

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 63 guests