cleolibrary / CLEO-Redux

Experimental JavaScript runtime for GTA 3D era games/GTA IV/Bully
https://re.cleo.li
Other
214 stars 20 forks source link

Heli.Create should return type Heli #93

Closed x87 closed 1 year ago

x87 commented 1 year ago

currently returns Car

x87 commented 1 year ago

https://github.com/Microsoft/TypeScript/issues/5863

edit: in fact, it is not a type-only issue as the inherited static Create returns an instance of the parent class (i.e. Car).

x87 commented 1 year ago

workaround: wrap in new Heli

let heli = new Heli(Car.Create(....));

same is true for other derived classes (Boat, Tank, Plane, etc)

x87 commented 1 year ago

Fixed in 1.2.0