JS: when RHS of as cast is non-nullable native interface, check LHS for null

This commit is contained in:
Alexey Andreev
2016-09-30 20:05:42 +03:00
parent e17321e1f6
commit 46242f4430
7 changed files with 56 additions and 4 deletions
@@ -0,0 +1,9 @@
@native 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"
}