Is there any way to deal with inheritance when using K/N as a dynamic library? I was hopeful I’d be able to cast the pointers and access different attributes of different classes, but that doesn’t appear to be the case.
A simple Kotlin setup I’m trying is
Copy code
abstract class Parent(val a: Int) {}
class Child(val b: Int, a: Int) : Parent(a) {}
fun make_thing(): Parent {
return Child(1, 2);
}
Michael Bryant
03/27/2019, 9:13 PM
and then in C, doing
Copy code
demo_kref_Parent parent = demo_symbols()->kotlin.root.make_thing();
demo_kref_Child* child_ptr = (demo_kref_Child*) parent.pinned;
demo_kref_Child child = *child_ptr;
int b = demo_symbols()->kotlin.root.Child.get_b(child);