So, I'm trying to write a simple manager where classes are registered and then instantiated later on. Something like this:
public function test() {
this.registerComp(EmptyComponent); // EmptyComponent is a class that implements the Component class.
}
// Component is a class with a few static functions for getting/setting id, etc.
public function registerComp<Component>(compRef:Class<Component>, ?withId:Int = 0):Void {
if (compRef == null)
throw 'Unable to register a nil component!';
var created = Type.createInstance(compRef, []);
trace("created: ",created, " from ",compRef);
}
This runs in HTML5 and on a Mac (C++/Objc?), but dies with Neko in OSX. I have a slight suspicion that it's a 3rd party app I'm running in the background (which also crashes whenever neko crashes via this code), but can't easily kill the 3rd party app to test.
Is this a valid bug or is it just on my machine? Anyone care to run it on mac/windows using neko?
-Mike