KT-53551 KT-52213 KT-58476 Fix handling of suspend functional types with context receivers
This commit is contained in:
committed by
Space Team
parent
c2ee9bb1a4
commit
88453a05f1
@@ -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"
|
||||
}
|
||||
Reference in New Issue
Block a user