Files
kotlin-fork/compiler/testData/codegen/box/funInterface/castFromAny.kt
T
2020-05-25 21:24:39 +03:00

21 lines
357 B
Kotlin
Vendored

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