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.
This commit is contained in:
committed by
Space Team
parent
15094eb03a
commit
35caae355d
@@ -0,0 +1,32 @@
|
||||
// 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"
|
||||
}
|
||||
Reference in New Issue
Block a user