Files
kotlin-fork/compiler/testData/codegen/boxInline/anonymousObject/sam.kt
T
2021-02-02 17:53:52 +03:00

20 lines
303 B
Kotlin
Vendored

// TARGET_BACKEND: JVM
// FILE: 1.kt
package test
inline fun <reified T> makeRunnable(noinline lambda: ()->Unit) : Runnable {
return Runnable(lambda)
}
// FILE: 2.kt
import test.*
fun box(): String {
var result = "fail"
makeRunnable<String> { result = "OK" }.run()
return result
}