Files
kotlin-fork/compiler/testData/codegen/boxInline/smap/anonymous/object.kt
T
Steven Schäfer 0da4b06074 psi2ir: Fix return insertion
We should only insert a return statement at the end of a lambda or
function if the final statement is used as an expression (slice
USED_AS_RESULT_OF_LAMBDA and USED_AS_EXPRESSION).
2019-10-31 11:13:44 +03:00

84 lines
717 B
Kotlin
Vendored

// FILE: 1.kt
package builders
inline fun call(crossinline init: () -> Unit) {
return object {
fun run () {
init()
}
}.run()
}
// FILE: 2.kt
import builders.*
fun test(): String {
var res = "Fail"
call {
res = "OK"
}
return res
}
fun box(): String {
return test()
}
//NO_CHECK_LAMBDA_INLINING
// FILE: 1.smap
SMAP
1.kt
Kotlin
*S Kotlin
*F
+ 1 1.kt
builders/_1Kt$call$1
*L
1#1,14:1
*E
// FILE: 2.smap
SMAP
2.kt
Kotlin
*S Kotlin
*F
+ 1 2.kt
_2Kt
+ 2 1.kt
builders/_1Kt
*L
1#1,22:1
7#2,5:23
*E
*S KotlinDebug
*F
+ 1 2.kt
_2Kt
*L
9#1,5:23
*E
SMAP
1.kt
Kotlin
*S Kotlin
*F
+ 1 1.kt
builders/_1Kt$call$1
+ 2 2.kt
_2Kt
*L
1#1,14:1
10#2,2:15
*E