Files
kotlin/compiler/testData/codegen/boxInline/anonymousObject/sam/anonymousObjectToSam.kt
2019-11-12 12:24:55 +01:00

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
}