Merge pull request #10291 from tamasvajk/kotlin-fix-array-set

Kotlin: Fix array `set` operator extraction
This commit is contained in:
Tamás Vajk
2022-09-06 09:01:05 +02:00
committed by GitHub
3 changed files with 68 additions and 19 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)