Kotlin: fix array iterator extraction to work outside of for loops

This commit is contained in:
Tamas Vajk
2022-08-25 09:23:31 +02:00
parent af2614be84
commit 7196fdd475
2 changed files with 4 additions and 4 deletions

View File

@@ -2177,7 +2177,7 @@ open class KotlinFileExtractor(
extractRawMethodAccess(getter, c, callable, parent, idx, enclosingStmt, listOf(), null, ext, typeArguments)
}
}
isFunction(target, "kotlin", "(some array type)", { isArrayType(it) }, "iterator") && c.origin == IrStatementOrigin.FOR_LOOP_ITERATOR -> {
isFunction(target, "kotlin", "(some array type)", { isArrayType(it) }, "iterator") -> {
findTopLevelFunctionOrWarn("kotlin.jvm.internal.iterator", "kotlin.jvm.internal.ArrayIteratorKt", c)?.let { iteratorFn ->
val dispatchReceiver = c.dispatchReceiver
if (dispatchReceiver == null) {