31 lines
538 B
Kotlin
Vendored
31 lines
538 B
Kotlin
Vendored
// !LANGUAGE: +ContextReceivers
|
|
// TARGET_BACKEND: JVM_IR
|
|
// WITH_STDLIB
|
|
// WITH_COROUTINES
|
|
|
|
// MODULE: lib
|
|
// FILE: A.kt
|
|
|
|
package a
|
|
|
|
context(String)
|
|
suspend fun f() = this@String
|
|
|
|
// MODULE: main(lib)
|
|
// FILE: B.kt
|
|
|
|
import helpers.*
|
|
import kotlin.coroutines.*
|
|
import kotlin.coroutines.intrinsics.*
|
|
|
|
fun box(): String {
|
|
var result: String = "fail"
|
|
val block: suspend () -> String = {
|
|
with("OK") { a.f() }
|
|
}
|
|
block.startCoroutine(handleResultContinuation { value ->
|
|
result = value
|
|
})
|
|
return result
|
|
}
|