Merge boxWithJava testData into box, delete BoxWithJava test
This commit is contained in:
committed by
Alexander Udalov
parent
16a0ddd2fb
commit
f8dfaf4599
+33
@@ -0,0 +1,33 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// FILE: CompanionInitialization.java
|
||||
|
||||
public class CompanionInitialization {
|
||||
|
||||
public static Object getCompanion() {
|
||||
return ConcreteWithStatic.Companion;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// FILE: CompanionInitialization.kt
|
||||
|
||||
interface IStatic
|
||||
|
||||
open class Static(x: IStatic) {
|
||||
fun doSth() {
|
||||
}
|
||||
}
|
||||
|
||||
class ConcreteWithStatic : IStatic {
|
||||
companion object : Static(ConcreteWithStatic())
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
ConcreteWithStatic.doSth()
|
||||
|
||||
val companion: Any? = CompanionInitialization.getCompanion()
|
||||
if (companion == null) return "fail 1"
|
||||
if (companion != ConcreteWithStatic) return "fail 2"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user