K2: generate Unit conversion for indexed assignment at raw FIR stage

#KT-59748 Fixed
This commit is contained in:
Mikhail Glukhikh
2023-07-24 22:11:30 +02:00
committed by Space Team
parent 1832413a02
commit f20e2dec31
33 changed files with 160 additions and 16 deletions
@@ -0,0 +1,14 @@
// ISSUE: KT-59748
// WITH_STDLIB
fun foo(list: MutableList<Any?>, condition: Boolean): Unit = when {
condition -> list[0] = "OK"
else -> Unit
}
fun box(): String {
val list = mutableListOf<Any?>("FAIL")
foo(list, true)
foo(list, false)
return list[0] as String
}