mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 00:21:47 +00:00
22 lines
391 B
Kotlin
Vendored
22 lines
391 B
Kotlin
Vendored
// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions
|
|
// TARGET_BACKEND: JVM
|
|
// IGNORE_BACKEND_FIR: JVM_IR
|
|
|
|
|
|
fun interface KRunnable {
|
|
fun invoke()
|
|
}
|
|
|
|
fun test(a: Any?) {
|
|
a as () -> Unit
|
|
KRunnable(a).invoke()
|
|
}
|
|
|
|
fun box(): String {
|
|
var result = "Fail"
|
|
test {
|
|
result = "OK"
|
|
}
|
|
return result
|
|
}
|