Files
kotlin-fork/compiler/testData/codegen/bytecodeText/properties/lateinit/companionObject.kt
T
2020-02-18 22:51:29 +03:00

30 lines
599 B
Kotlin
Vendored

class Foo {
private companion object {
lateinit var x: String
fun test() {
consume(x)
consume(x)
consume(x)
consume(x)
}
}
fun test2() {
consume(x)
consume(x)
consume(x)
consume(x)
}
}
fun consume(s: String) {}
// JVM_TEMPLATES
// There's 1 assertion in Foo.Companion.getX, and 4 in Foo.test2 (see KT-28331)
// 5 throwUninitializedPropertyAccessException
// JVM_IR_TEMPLATES
// JVM_IR invokes getX() (as suggested in KT-28331)
// 1 throwUninitializedPropertyAccessException