Hello! ```interface A { val x : Int } interfa...
# getting-started
p
Hello!
Copy code
interface A {
    val x : Int
}

interface B : A {
    override val x: Int
        get() = 1
}

open class C(
    final override val x: Int
) : A

class D(
    x: Int
) : C(x), B // Error : Class 'D' must override public final val x: Int defined in C because it inherits many implementations of it
// but how to override if x is final in C ?
j
I don't think you can. This looks like the classic "diamond of death" with the
final
disabling the workaround
c
Copy code
how to override if x is final in C
You can't.
final
means "forbid overriding", so it's forbidden.
p
I thought Interface DEFAULT implementetion means applying it if there is no class implementation even if class is super.
c
Yes. D has a super class, so C takes priority.
p
I also thought so. But it is not. I've got compilation error.