Files
kotlin-fork/compiler/testData/codegen/bytecodeText/properties/lateinit/companionObjectFromLambda.kt
T
Steven Schäfer 7d59c7689c JVM IR: Avoid direct invokes in callable reference tests
Due to the direct invoke optimization, most callable reference tests
were not generating callable references/lambdas.
2022-07-14 23:24:18 +02:00

21 lines
420 B
Kotlin
Vendored

class Foo {
private companion object {
lateinit var x: String
fun test() {
consume({ x }.let { it() });
{ consume(x) }.let { it() }
}
}
fun test2() {
consume({ x }.let { it() });
{ consume(x) }.let { it() }
}
}
fun consume(s: String) {}
// There's only one assertion in Foo.Companion.getX
// 1 throwUninitializedPropertyAccessException