Files
kotlin/compiler/testData/codegen/box/objects/selfReferenceToInterfaceCompanionObjectInInlineLambdaInConstructorBody.kt
pyos 939a9ff53e JVM_IR: fix NPE in interface companion initializers
* When referencing the companion itself, they should use the $$INSTANCE
  field, not the (null until <clinit> returns) Companion field of the
  interface.

* Interface companion init blocks should be made static.
2019-11-20 14:37:19 +01:00

10 lines
183 B
Kotlin
Vendored

// IGNORE_BACKEND_FIR: JVM_IR
interface Test {
companion object {
fun ok() = "OK"
val x = run { Test.ok() }
fun test() = x
}
}
fun box() = Test.test()