Hashlink hl_dyn_call and abstract

Is it possible to pass a Hashlink abstract from c++ using hl_dyn_call?
Stepping through the call, it fails on trying to cast the abstract to a dynamic in hl_dyn_castp.

After digging a bit more, i created an hl_type abstract for “foo”, but it seems the hl_same_type check compares a.abs_name == b.abs_name which will fail.

// psuedo code
// callback is rooted
vclosure* callback;

void invoke(Foo* foo)
{
    vdynamic* args[1];

    args[0] = hl_make_dyn(fpp, &hlt_abstract);

    hl_dyn_call(callback, args, 1); // cast error here
}

// haxe function sig

function callback(value:hl.Abstract<"foo">):Void

Thanks

when you wrap an abstract as a dynamic you need to know its exact hl_type*
the best to is register it from Haxe, you can get the type value using
hl.Type.get((cast null : hl.Abstract<"foo">))

Thanks!

I made a quick local change in types.c to not assume the abs_name is ==

return a->abs_name == b->abs_name || ucmp(a->abs_name, b->abs_name) == 0

If the intent is for the abstract hl_type should point to a shared name, I can use your approach to pass it through some registration call to the native side.