KT-53551 KT-52213 KT-58476 Fix handling of suspend functional types with context receivers

This commit is contained in:
strangepleasures
2023-09-07 12:40:01 +00:00
committed by Space Team
parent c2ee9bb1a4
commit 88453a05f1
10 changed files with 184 additions and 1 deletions
@@ -0,0 +1,20 @@
// !LANGUAGE: +ContextReceivers
// TARGET_BACKEND: JVM_IR
// WITH_STDLIB
// WITH_COROUTINES
interface Context
class Receiver
interface Action {
context (Context)
fun run()
}
fun execute(block: suspend context(Context) Receiver.(Action) -> Unit) = Unit
fun box(): String {
execute { it.run() }
return "OK"
}