COMMUNITY

Generic with extern type? [hxcpp]

Hey :wink:
Is it possible to use generics with extern types?
Don’t know why, but it replace T with Dynamic type.
Is it a bug or I’m doing something wrong?

@:native('NativeObject.h')
extern class NativeObject 
{
    //...
    public function setValue(value:Int):Void;
}

class HaxeObject<T:NativeObject>
{
    private var ref:Pointer<T>; //generated as Pointer<Dynamic>. But I want to get Pointer<NativeObject>
    public function new()
    {
        //...
    }
    
    public function setValue(value:Int):Void
    {
        ref.setValue(value);
    }
}

Looks like it is a problem not only with extern classes.
I’ve created issue about this: https://github.com/HaxeFoundation/hxcpp/issues/670