Files
kotlin-fork/js/js.translator/testData/box/native/castToNullableNativeInterface.kt
T

12 lines
231 B
Kotlin
Vendored

// EXPECTED_REACHABLE_NODES: 488
external interface I {
fun foo(): String
}
fun createObject(): Any? = null
fun box(): String {
val result = (createObject() as I?)?.foo()
return if (result == null) "OK" else "fail"
}