Files
kotlin-fork/compiler/testData/codegen/box/funInterface/castFromAny.kt
T
2021-10-08 07:24:41 +03:00

20 lines
338 B
Kotlin
Vendored

// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions
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
}