Consider the following code.
Common module:
interface A {
fun foo() { print("A") }
}
Android module:
class AImpl : A {
//Doesn't need to implement
}
iOS project (Swift):
class AImpl : A {
//Swift Compiler Error: Type AImpl2 does not conform to protocol A
}
The Swift compiler requires that the foo
method be implemented, even if it is already implemented by the interface.
Implementing it in the Kotlin module (iosMain) is not an option because I need to use some of the SwiftUI property wrappers, which are not available in the Kotlin module.
Is it a K/N limitation? Is there any way to get around it?