Reimplement the same hacky approach used in the old backend (see
cc2fe6b0c6).
Previously, the debugger incorrectly stepped into Collections.kt on
"step over" inline function calls from stdlib like 'any'.
Since `if` and `when` expressions are represented the same way in IR,
the behavior is fixed for both of them. It's not the case in the old JVM
backend, where stepping over `when` conditions still suffers from the
same problem, which the newly added test checks.
57 lines
833 B
Kotlin
Vendored
57 lines
833 B
Kotlin
Vendored
// FILE: test.kt
|
|
fun box() {
|
|
if (inlineFun()) {
|
|
nop()
|
|
}
|
|
|
|
if (
|
|
inlineFun().rid() &&
|
|
inlineFun()
|
|
) {
|
|
nop()
|
|
}
|
|
|
|
if (
|
|
id(
|
|
inlineFun()
|
|
)
|
|
) {
|
|
nop()
|
|
}
|
|
}
|
|
|
|
inline fun inlineFun(): Boolean {
|
|
return true
|
|
}
|
|
|
|
inline fun id(x: Boolean): Boolean = x
|
|
inline fun Boolean.rid(): Boolean = this
|
|
|
|
fun nop() {}
|
|
|
|
// LINENUMBERS
|
|
// test.kt:3 box
|
|
// test.kt:24 box
|
|
// test.kt:3 box
|
|
// test.kt:4 box
|
|
// test.kt:30 nop
|
|
// test.kt:8 box
|
|
// test.kt:24 box
|
|
// test.kt:8 box
|
|
// test.kt:28 box
|
|
// test.kt:8 box
|
|
// test.kt:9 box
|
|
// test.kt:24 box
|
|
// test.kt:9 box
|
|
// test.kt:11 box
|
|
// test.kt:30 nop
|
|
// test.kt:16 box
|
|
// test.kt:24 box
|
|
// test.kt:16 box
|
|
// test.kt:15 box
|
|
// test.kt:27 box
|
|
// test.kt:15 box
|
|
// test.kt:19 box
|
|
// test.kt:30 nop
|
|
// test.kt:21 box
|