Kotlin: Fix array set operator extraction

This commit is contained in:
Tamas Vajk
2022-09-05 10:19:35 +02:00
parent 608f99bd0d
commit 6f7f760682
3 changed files with 13 additions and 3 deletions

View File

@@ -2208,7 +2208,7 @@ open class KotlinFileExtractor(
tw.writeExprsKotlinType(id, type.kotlinResult.id)
binopDisp(id)
}
isFunction(target, "kotlin", "(some array type)", { isArrayType(it) }, "set") && c.origin == IrStatementOrigin.EQ -> {
isFunction(target, "kotlin", "(some array type)", { isArrayType(it) }, "set") && c.origin == IrStatementOrigin.EQ && c.dispatchReceiver != null -> {
val array = c.dispatchReceiver
val arrayIdx = c.getValueArgument(0)
val assignedValue = c.getValueArgument(1)