Page 1 of 1

Hotkey not working if first Line defines a Class

Posted: 04 Nov 2014, 11:09
by alllala

Code: Select all

^!6::
;Some command must be here or the class/hotkey does not work
class baseObject {
    static foo := "bar"
}
obj1 := Object(), obj1.base := baseObject
obj2 := {base: baseObject}
obj3 := new baseObject

MsgBox % obj1.foo " " obj2.foo " " obj3.foo
Using AHK 1.16.05 and I´m not sure if this is a bug or a feature I don´t get.

Re: Hotkey not working if first Line defines a Class

Posted: 05 Nov 2014, 03:40
by Xerxes77
Yeah that's really strange.. I was just about to reply saying that the hotkey worked fine for me but then when I upgraded my version from 1.1.14.03 to 1.1.16.05 it stopped working. :?

Re: Hotkey not working if first Line defines a Class

Posted: 15 Nov 2014, 17:19
by lexikos
It is a bug, and ListLines will show you that it is executing the static initializer.

Re: Hotkey not working if first Line defines a Class

Posted: 27 Dec 2014, 01:13
by lexikos
Fixed in v1.1.17.