Files
kotlin-fork/compiler/testData/ir/irText/expressions/lambdaInCAO.kt.txt
T
Dmitriy Novozhilov b454fcc1e0 [FIR] Save IR dumps to .ir.txt files instead of .txt in tests
This is needed to avoid clashes between different dumps from different
  handlers
2021-10-12 17:26:36 +03:00

41 lines
837 B
Plaintext
Vendored

operator fun Any.plusAssign(lambda: Function0<Unit>) {
}
operator fun Any.get(index: Function0<Unit>): Int {
return 42
}
operator fun Any.set(index: Function0<Unit>, value: Int) {
}
fun test1(a: Any) {
a.plusAssign(lambda = local fun <anonymous>() {
return Unit
}
)
}
fun test2(a: Any) {
{ // BLOCK
val tmp0_array: Any = a
val tmp1_index0: Function0<Unit> = local fun <anonymous>() {
return Unit
}
tmp0_array.set(index = tmp1_index0, value = tmp0_array.get(index = tmp1_index0).plus(other = 42))
}
}
fun test3(a: Any) {
{ // BLOCK
val tmp0_array: Any = a
val tmp1_index0: Function0<Unit> = local fun <anonymous>() {
return Unit
}
val tmp2: Int = tmp0_array.get(index = tmp1_index0)
tmp0_array.set(index = tmp1_index0, value = tmp2.inc())
tmp2
} /*~> Unit */
}