Hi guys! How can I achieve this?
fun main(args: Array<String>) {
val obj = C()
obj.a()
obj.b()
obj.foo()
}
interface A {
fun a()
fun foo()
}
interface B {
fun b()
fun foo()
}
class A1 : A {
override fun foo() = Unit
override fun a() = println("this is a!")
}
class B1 : B {
override fun foo() = println("this is foo!")
override fun b() = println("this is b!")
}
class C : A by A1(), B by B1() {
override fun foo() {
super<A>.foo()
}
}
the line super<A>.foo()
doesnt compile. “Abstract method cannot be accessed directly.”