RTTI property not found for CPP targets in Haxe NME

166 Views Asked by At

I'm using rtti in haxe nme. It works well when targeting flash but when compiling to a cpp target I receive the following error.

error C2039: '__rtti' : is not a member of 'Class_obj'

I'm doing this...

public function doSomething(type:Class<Dynamic>):Void {
    var typeInfo:String = untyped type.__rtti;
}

I also tried...

public function doSomething <T:Infos> (type:Class<T>):Void {
    var typeInfo:String = untyped type.__rtti;
}

What should I do?

1

There are 1 best solutions below

0
On BEST ANSWER

Make it looser! :Dynamic instead of :Class<Dynamic>

public function doSomething(type:Dynamic):Void {
    var typeInfo:String = untyped type.__rtti;
}