2

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?

Sri Harsha Chilakapati
  • 11,744
  • 6
  • 50
  • 91
Tom
  • 1,610
  • 1
  • 15
  • 19

1 Answers1

1

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

public function doSomething(type:Dynamic):Void {
    var typeInfo:String = untyped type.__rtti;
}
Sri Harsha Chilakapati
  • 11,744
  • 6
  • 50
  • 91
Tom
  • 1,610
  • 1
  • 15
  • 19