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?

有帮助吗?

解决方案

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

public function doSomething(type:Dynamic):Void {
    var typeInfo:String = untyped type.__rtti;
}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top