Override init in a parent class

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")
    }
}

I’m surprised the hack works, as certainly in C++ for example, the A is constructed first, as an A, then the B on top. This surprises programmers who call virtual functions in their constructors. Your example is a ‘code smell’ to me but if you really want to do that, how about:

open class A(isB: Boolean = false) {
    init {
        if (!isB) meth()
    }
    ...

Real clean code is do not activate vars in a parent class. But they can’t do it at compile time.

P.S. How do you do such stuff in your code?