Files
kotlin-fork/compiler/testData/codegen/box/funInterface/castFromAny.kt
T
2020-11-09 16:04:43 +03:00

22 lines
413 B
Kotlin
Vendored

// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: STDLIB_COLLECTIONS
// !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
}