mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-10 15:53:46 +00:00
17 lines
283 B
Kotlin
Vendored
17 lines
283 B
Kotlin
Vendored
// TARGET_BACKEND: JVM
|
|
// FILE: 1.kt
|
|
package test
|
|
|
|
inline fun f(crossinline g: () -> Unit) = Runnable(object : () -> Unit {
|
|
override fun invoke() = g()
|
|
})
|
|
|
|
// FILE: 2.kt
|
|
import test.*
|
|
|
|
fun box(): String {
|
|
var result = "FAIL"
|
|
f { result = "OK" }.run()
|
|
return result
|
|
}
|