Debugger, BE: Generate original line number after inlining if call is used in an if condition

If a part of an 'if' condition is an inline function call, we need to insert the original condition line after it. Otherwise, the debugger will think it is inside the inline function implementation. Obviously, this breaks stepping – instead of the 'if' body, we go on stepping through the inline function.

This commit fixes 'KotlinSteppingTestGenerated.StepOver#testSoInlineLibFun' test.
This commit is contained in:
Yan Zhulanow
2019-12-23 18:08:13 +09:00
parent f115bde682
commit cc2fe6b0c6
10 changed files with 76 additions and 12 deletions
@@ -0,0 +1,17 @@
//FILE: test.kt
// IGNORE_BACKEND: JVM_IR
fun box() {
if (listOf(1, 2, 3).myAny { it > 2 }) {
println("foo")
}
}
public inline fun <T> Iterable<T>.myAny(predicate: (T) -> Boolean): Boolean {
for (element in this) {
if (predicate(element)) return true
}
return false
}
// 3 LINENUMBER 5
@@ -0,0 +1,16 @@
//FILE: test.kt
fun box() {
if (listOf(1, 2, 3).myAny { it > 2 } == true) {
println("foo")
}
}
public inline fun <T> Iterable<T>.myAny(predicate: (T) -> Boolean): Boolean {
for (element in this) {
if (predicate(element)) return true
}
return false
}
// 3 LINENUMBER 4