Files
kotlin-fork/compiler/testData/codegen/box/funInterface/castFromAny.kt
T
2020-07-10 11:30:42 +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
}