Files
kotlin-fork/compiler/testData/codegen/bytecodeText/coercionToUnitOptimization/nopInlineFuns.kt
T
Mads Ager 0505bd958a [JVM] Fix the nop removal optimization.
Never remove a nop if that would cause a line number to move
across a local lifetime boundary.

This fixes KT-42725.
2020-10-16 19:21:08 +03:00

27 lines
441 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()
}
fun simpleFunInt(f: () -> Int): Int {
return f()
}
fun simpleFunVoid(f: () -> Unit): Unit {
return f()
}
// 0 NOP