Files
kotlin-fork/compiler/testData/codegen/box/funInterface/castFromAny.kt
T
2021-10-01 17:18:49 +03:00

22 lines
410 B
Kotlin
Vendored

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