Where to file Neko crashes/bugs? Any clue on this one (creating an instance from a class ref)?

21 views
Skip to first unread message

Michael Whitaker

unread,
Sep 25, 2013, 12:39:36 PM9/25/13
to haxe...@googlegroups.com
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

Nicolas Cannasse

unread,
Sep 25, 2013, 2:47:17 PM9/25/13
to haxe...@googlegroups.com
[...]
> 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?

What do you mean by "crash" ? Do you get an exception/error message ? If
yes which ?

Best,
Nicolas

dlots

unread,
Sep 25, 2013, 2:56:24 PM9/25/13
to haxe...@googlegroups.com
Neko reflection requires the same number of arguments as declared in the arguments array regardless of their optional declaration. If you have optional constructor arguments you need to pass a value in for them.
Reply all
Reply to author
Forward
0 new messages