[FIR2IR] Fix conversion of loops with withIndex

This commit is contained in:
Ivan Kochurkin
2021-10-15 01:15:38 +03:00
committed by TeamCityServer
parent a2ec99e38c
commit b4fada82ae
54 changed files with 149 additions and 172 deletions
@@ -55,14 +55,12 @@ class DeepCopyIrTreeWithSymbols {
val <iterator>: Iterator<Pair<IrTypeParameter, IrTypeParameter>> = <this>.<get-typeParameters>().zip<IrTypeParameter, IrTypeParameter>(other = other.<get-typeParameters>()).iterator()
while (<iterator>.hasNext()) { // BLOCK
val <destruct>: Pair<IrTypeParameter, IrTypeParameter> = <iterator>.next()
{ // BLOCK
val thisTypeParameter: IrTypeParameter = <destruct>.component1()
val otherTypeParameter: IrTypeParameter = <destruct>.component2()
otherTypeParameter.<get-superTypes>().mapTo<IrType, IrType, MutableList<IrType>>(destination = thisTypeParameter.<get-superTypes>(), transform = local fun <anonymous>(it: IrType): IrType {
return <this>.<get-typeRemapper>().remapType(type = it)
}
)
val thisTypeParameter: IrTypeParameter = <destruct>.component1()
val otherTypeParameter: IrTypeParameter = <destruct>.component2()
otherTypeParameter.<get-superTypes>().mapTo<IrType, IrType, MutableList<IrType>>(destination = thisTypeParameter.<get-superTypes>(), transform = local fun <anonymous>(it: IrType): IrType {
return <this>.<get-typeRemapper>().remapType(type = it)
}
)
}
}
}
@@ -77,3 +75,4 @@ inline fun <T : Any?> TypeRemapper.withinScope(irTypeParametersContainer: IrType
<this>.leaveScope()
return result
}