Files
kotlin-fork/compiler/testData/codegen/boxInline/suspend/stateMachine/innerLambdaWithoutCrossinline.kt
T
Ilmir Usmanov 63f6d515bc JVM_IR: Generate correct invoke of numbered suspend lambda
Instead of continuation type as last parameter's type, generate Object
type.
2019-09-19 19:28:05 +03:00

43 lines
910 B
Kotlin
Vendored

// FILE: inlined.kt
// COMMON_COROUTINES_TEST
// WITH_RUNTIME
// WITH_COROUTINES
// NO_CHECK_LAMBDA_INLINING
// CHECK_STATE_MACHINE
import COROUTINES_PACKAGE.intrinsics.*
import helpers.*
suspend inline fun crossinlineMe(crossinline c: suspend () -> Unit) {
val l: suspend () -> Unit = {
StateMachineChecker.suspendHere()
StateMachineChecker.suspendHere()
StateMachineChecker.suspendHere()
StateMachineChecker.suspendHere()
StateMachineChecker.suspendHere()
}
l()
l()
}
// FILE: inlineSite.kt
// COMMON_COROUTINES_TEST
import COROUTINES_PACKAGE.*
import helpers.*
fun builder(c: suspend () -> Unit) {
c.startCoroutine(CheckStateMachineContinuation)
}
fun box(): String {
var res = "OK"
builder {
crossinlineMe {
res = "FAIL 1"
}
}
StateMachineChecker.check(numberOfSuspensions = 10)
return res
}