[FIR2IR] Fix generating body for for-loop

This commit is contained in:
Dmitriy Novozhilov
2021-03-29 14:12:22 +03:00
committed by TeamCityServer
parent 5d78b0a962
commit d0a148074f
19 changed files with 493 additions and 154 deletions
@@ -55,12 +55,14 @@ 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()
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)
}
{ // 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)
}
)
}
}
}
}
@@ -75,3 +77,4 @@ inline fun <T : Any?> TypeRemapper.withinScope(irTypeParametersContainer: IrType
<this>.leaveScope()
return result
}