To be more precise: ```open class A { fun te...
# kotlin-native
j
To be more precise:
Copy code
open class A {
    fun testA() {
        println("testA")
    }

    open fun test() {
        println("aaa")
    }
}

class B: A() {
    fun testB() {
        println("testA")
    }

    override fun test() {
        println("bbb")
    }
}
this leads to c code of:
Copy code
struct {
                  lib_sdk_KType* (*_type)(void);
                  lib_sdk_kref_sdk_A (*A)();
                  void (*test)(lib_sdk_kref_sdk_A thiz);
                  void (*testA)(lib_sdk_kref_sdk_A thiz);
                } A;
                struct {
                  lib_sdk_KType* (*_type)(void);
                  lib_sdk_kref_sdk_B (*B)();
                  void (*test)(lib_sdk_kref_sdk_B thiz);
                  void (*testB)(lib_sdk_kref_sdk_B thiz);
                } B;
and overriding testA with a super call:
Copy code
open class A {
    open fun testA() {
        println("testA")
    }

    open fun test() {
        println("aaa")
    }
}

class B: A() {
    fun testB() {
        println("testA")
    }

    override fun test() {
        println("bbb")
    }

    override fun testA() = super.testA()
}
leads to:
Copy code
struct {
                  lib_sdk_KType* (*_type)(void);
                  lib_sdk_kref_sdk_A (*A)();
                  void (*test)(lib_sdk_kref_sdk_A thiz);
                  void (*testA)(lib_sdk_kref_sdk_A thiz);
                } A;
                struct {
                  lib_sdk_KType* (*_type)(void);
                  lib_sdk_kref_sdk_B (*B)();
                  void (*test)(lib_sdk_kref_sdk_B thiz);
                  void (*testA)(lib_sdk_kref_sdk_B thiz);
                  void (*testB)(lib_sdk_kref_sdk_B thiz);
                } B;
is this on purpose? should i really add overrides with a single super call to all the places? should i cast a B instance to A and use struct A to call overriden testA func with the casted instance? All of this feels unnecessary complex
i really can't find any infos regarding inheritance and compilation to a lib.