Files
kotlin-fork/js/js.translator/testData/box/native/safeCastToNativeInterface.kt
T
2017-07-19 12:24:09 +03:00

10 lines
229 B
Kotlin
Vendored

// EXPECTED_REACHABLE_NODES: 991
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"
}