Files
kotlin-fork/compiler/testData/codegen/box/classes/privateOuterProperty.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

32 lines
502 B
Kotlin
Vendored

class C{
private var v : Int = 0
public fun foo() : Int {
{
v = v + 1
}.let { it.invoke() }
object : Runnable {
public override fun run() {
v = v + 1
}
}.run()
Inner().innerFun()
return v
}
private inner class Inner() {
fun innerFun() {
v = v + 1
}
}
}
interface Runnable {
fun run(): Unit
}
fun box() = if (C().foo() == 3) "OK" else "NOT OK"