Files
kotlin-fork/compiler/testData/codegen/bytecodeText/coercionToUnitOptimization/nopInlineFuns.kt
T
pyos c43acba0b9 JVM: restore call site line number after inlining lambda
E.g. in `x + f()` where `f` is an inline lambda, the instructions for
`+` should have the line number of that expression (while previously
they instead had the line number of the last line of the lambda).

^KT-51738 Fixed
2022-05-02 19:28:10 +02:00

27 lines
559 B
Kotlin
Vendored

fun test() {
val a = inlineFunInt { 1 }
val b = simpleFunInt { 1 }
val c = inlineFunVoid { val aa = 1 }
val d = simpleFunVoid { val aa = 1 }
}
inline fun inlineFunInt(f: () -> Int): Int {
val a = 1
return f()
}
inline fun inlineFunVoid(f: () -> Unit): Unit {
val a = 1
return f() // return replaced with nop to stop here *after* calling f
}
fun simpleFunInt(f: () -> Int): Int {
return f()
}
fun simpleFunVoid(f: () -> Unit): Unit {
return f() // return replaced with nop to stop here *after* calling f
}
// 2 NOP