// WITH_RUNTIME interface A { fun foo(): Collection } interface B : A { override fun foo(): MutableCollection } class C : B { override fun foo(): MutableList = ArrayList(listOf("C")) } fun box(): String { val c = C() var r = c.foo().iterator().next() val b: B = c val a: A = c r += b.foo().iterator().next() r += a.foo().iterator().next() return if (r == "CCC") "OK" else "Fail: $r" }