open class A { open fun foo() { } } trait Z { } class B: A, Z { override fun foo() { } }