17 lines
281 B
Kotlin
Vendored
17 lines
281 B
Kotlin
Vendored
// !LANGUAGE: +ContextReceivers
|
|
// TARGET_BACKEND: JVM_IR
|
|
// WITH_STDLIB
|
|
|
|
typealias StringProvider = () -> String
|
|
|
|
context(StringProvider)
|
|
fun doSomething() {
|
|
println(this@StringProvider())
|
|
}
|
|
|
|
fun box(): String {
|
|
with({ "" }) {
|
|
doSomething()
|
|
}
|
|
return "OK"
|
|
} |