Files
kotlin-fork/compiler/testData/codegen/boxInline/suspend/inlineSuspendInMultifileClass.kt
T
Ivan Kylchik c7435ba760 Replace all occurrences of WITH_RUNTIME with WITH_STDLIB
We are going to deprecate `WITH_RUNTIME` directive. The main reason
behind this change is that `WITH_STDLIB` directive better describes
its meaning, specifically it will add kotlin stdlib to test's classpath.
2021-11-17 15:26:38 +03:00

35 lines
721 B
Kotlin
Vendored

// TARGET_BACKEND: JVM
// IGNORE_BACKEND_MULTI_MODULE: JVM, JVM_MULTI_MODULE_OLD_AGAINST_IR
// IGNORE_BACKEND: JVM
// WITH_COROUTINES
// NO_CHECK_LAMBDA_INLINING
// WITH_STDLIB
// INHERIT_MULTIFILE_PARTS
// FILE: test.kt
// The lambda in box() attempts to store the result in a null Ref for some reason.
@file:JvmMultifileClass
@file:JvmName("XKt")
suspend fun suspendHere() {}
suspend inline fun test(c: suspend () -> String): String {
suspendHere()
val result = c()
suspendHere()
return result
}
// FILE: box.kt
import kotlin.coroutines.*
import helpers.*
fun box() : String {
var res = "fail"
suspend {
res = test { "OK" }
}.startCoroutine(EmptyContinuation)
return res
}