JS_IR: fix typecheck corner case
Consider `fun <E : I> foo(a: Any?) = a as? E`, where I is an interface. This check used to fail, because the `a == null` was missing, and the `isInterface` stdlib method crashes if the first argument is null. This change adds the null check. Also this change prettifies the instance check in case of type parameter left operand.
This commit is contained in:
committed by
Anton Bannykh
parent
9a971172c9
commit
d6fcde7316
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
interface I
|
||||
|
||||
fun <E: I> foo(a: Any?): E? = a as? E
|
||||
|
||||
fun box() = foo<I>(null) ?: "OK"
|
||||
Reference in New Issue
Block a user