Files
kotlin-fork/compiler/testData/codegen/box/javaInterop/javaForKotlinOverrideProperty.kt
T
Alexander Udalov 35caae355d Tests: minor, add box test for KT-31367/KT-61805
For some reason, codegen box test was not added in 082c337faa. The main
point of it now is to check that everything works correctly in the
IrFakeOverrideBuilder mode.
2024-01-17 12:27:36 +00:00

33 lines
575 B
Kotlin
Vendored

// TARGET_BACKEND: JVM
// FILE: A.java
public abstract class A {
public String getValue() {
return "A";
}
}
// FILE: I.kt
interface I {
val value: String?
}
// FILE: B.java
public class B extends A implements I {}
// FILE: C.kt
class C : B(), I
fun box(): String {
val c = C()
if (c.value != "A") return "Fail C"
if ((c as B).value != "A") return "Fail B"
if ((c as I).value != "A") return "Fail I"
if ((c as A).value != "A") return "Fail A value"
if ((c as A).getValue() != "A") return "Fail A getValue"
return "OK"
}