c43acba0b9
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
27 lines
559 B
Kotlin
Vendored
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
|