[JVM] Improve debug step behavior around lambdas.
- Add tests to clarify problematic behavior - Avoid line numbers on return instructions of lambdas without explicit returns
This commit is contained in:
committed by
max-kammerer
parent
fc7d667282
commit
7ec4c9990a
@@ -0,0 +1,42 @@
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
// FILE: test.kt
|
||||
inline fun foo(stringMaker: () -> String = { "OK" }): String {
|
||||
return stringMaker()
|
||||
}
|
||||
|
||||
inline fun foo2(stringMaker: () -> String = {
|
||||
"OK"
|
||||
// Comment
|
||||
}): String {
|
||||
return stringMaker()
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
foo()
|
||||
foo2()
|
||||
return "OK"
|
||||
}
|
||||
|
||||
// The IR Backend does the following:
|
||||
// test.kt:15
|
||||
// test.kt:3
|
||||
// test.kt:4
|
||||
// test.kt:3
|
||||
// test.kt:3 <---
|
||||
// test.kt:16
|
||||
// test.kt:7
|
||||
// test.kt:11
|
||||
// test.kt:8
|
||||
// test.kt:7 <---
|
||||
// test.kt:17
|
||||
|
||||
// LINENUMBERS
|
||||
// test.kt:15
|
||||
// test.kt:3
|
||||
// test.kt:4
|
||||
// test.kt:3
|
||||
// test.kt:16
|
||||
// test.kt:7
|
||||
// test.kt:11
|
||||
// test.kt:8
|
||||
// test.kt:17
|
||||
Reference in New Issue
Block a user