// This test depends on line numbers // IGNORE_INLINER: IR // WITH_STDLIB // FILE: 1.kt package test interface SuspendRunnable { suspend fun run() } inline suspend fun inlineMe1(crossinline c: suspend () -> Unit): SuspendRunnable = object : SuspendRunnable { override suspend fun run() { c() } } inline suspend fun inlineMe2(crossinline c: suspend () -> Unit): suspend () -> Unit = { c() } // FILE: 2.kt import kotlin.coroutines.* import kotlin.coroutines.intrinsics.* import test.* fun builder(c: suspend () -> Unit) { c.startCoroutine(object: Continuation { override val context = EmptyCoroutineContext override fun resumeWith(result: Result) { result.getOrThrow() } }) } fun box(): String { var res = "" builder { inlineMe1 { res += "O" }.run() inlineMe2 { res += "K" }() } return res }