JVM_IR: add coercion for index in ArrayGet intrinsic

This commit is contained in:
Georgy Bronnikov
2019-12-17 15:50:36 +03:00
parent cca3f13e48
commit 220ea72d65
9 changed files with 50 additions and 2 deletions
@@ -0,0 +1,14 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun test(ix: Int?): String {
val arr = arrayOf("fail 1")
if (ix != null) {
arr[ix] = "OK"
return arr[ix]
}
return "fail 2"
}
fun box() = test(0)