Files
kotlin-fork/compiler/testData/codegen/box/bridges/fakeOverrideFromInterfaceThroughIntermediateClass.kt
T
Ilya Chernikov 78ca733c38 FIR JS: add K2 variants of all other JS tests
except tests that are not possible to add without some modifications in
the test infra. See todos on the commented-out test declarations
2022-11-12 16:28:24 +01:00

24 lines
470 B
Kotlin
Vendored

// !LANGUAGE: -AbstractClassMemberNotImplementedWithIntermediateAbstractClass
// IGNORE_BACKEND_K2: JVM_IR, JS_IR
// FIR status: don't support legacy feature
interface A {
fun foo(): Any
}
interface B {
fun foo(): String = "A"
}
open class D: B
open class C: D(), A
fun box(): String {
val a: A = C()
if (a.foo() != "A") return "Fail 1"
if ((a as B).foo() != "A") return "Fail 2"
if ((a as C).foo() != "A") return "Fail 3"
return "OK"
}