Files
kotlin-fork/compiler/testData/codegen/box/extensionFunctions/contextReceivers/contextualFunctionConversion.kt
T
2021-12-02 20:24:56 +03:00

13 lines
271 B
Kotlin
Vendored

// !LANGUAGE: +ContextReceivers
// TARGET_BACKEND: JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR
fun withContext(f: context(String) () -> String) = f("OK")
fun callWithContext(f: (String) -> String) = withContext(f)
fun box(): String {
return callWithContext { s -> s }
}