Files
kotlin-fork/compiler/testData/codegen/box/funInterface/castFromAny.kt
T
2020-01-17 19:36:09 +03:00

19 lines
335 B
Kotlin
Vendored

// !LANGUAGE: +NewInference +FunctionInterfaceConversion +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
}