blob: 66118b7b58a6e8efa7be95e9586a19fd718b14df [file]
// LANGUAGE: +CompanionBlocks +CompanionExtensions
// KT-89290, KT-89375
// IGNORE_BACKEND: NATIVE
// ^^^ KT-89375 Native: companion block members are not initialized when observed from a nested class
class I {
companion {
private lateinit var late: String
private val init = initLate()
private fun initLate() {
late = "late"
}
}
class NestedClass {
fun check() = ::late.isInitialized
}
}
fun box(): String {
if (!I.NestedClass().check()) return "fail"
return "OK"
}