JS: when RHS of as cast is non-nullable native interface, check LHS for null
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
@native interface I {
|
||||
fun foo(): String
|
||||
}
|
||||
|
||||
fun createObject(): Any? = null
|
||||
|
||||
fun box(): String {
|
||||
try {
|
||||
(createObject() as I).foo()
|
||||
return "fail: exception not thrown"
|
||||
}
|
||||
catch (e: ClassCastException) {
|
||||
return "OK"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user