I have the following classes and interface:
class A() {
fun one() {...}
fun two() {...}
}
class B(): A, C {
fun tree() {...}
}
interface C {
fun one()
fun two()
fun tree()
}
As you can class B extends A and also implements interface C. The problem is that in Kotlin class B which is the actual implementor of C does not have the 2 first funcs and therefore not implementing the right functions for the interface. Is there a right way to do such thing?
oneandtwosatisfy the interface contract. If you want to override them, you need to mark the functionsopenin class A. And of course, class A itself must be marked open for your above code to compile.Class 'B' is not abstract and does not implement abstract member public abstract fun one()