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:
@@ -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
|
||||
Reference in New Issue
Block a user