Was surprised that both parent and a child initialize overridden params, but actually got this case trying to override unused params in multiple delegate inheritance with throw
. Currentl question is: how to override init block in a parent class? Currently I use a hack with is
:
open class A {
init {
if (this !is B) meth()
}
open fun meth() {
println("Hello")
}
}
class B : A() {
init {
meth()
}
override fun meth() {
println("World")
}
}