class DeepCopyIrTreeWithSymbols { private val typeRemapper: TypeRemapper field = typeRemapper private get constructor(typeRemapper: TypeRemapper) /* primary */ { super/*Any*/() /* () */ } private fun copyTypeParameter(declaration: IrTypeParameter): IrTypeParameter { return declaration } fun IrTypeParametersContainer.copyTypeParametersFrom(other: IrTypeParametersContainer) { .( = other.().map(transform = local fun (it: IrTypeParameter): IrTypeParameter { return .copyTypeParameter(declaration = it) } )) .().withinScope(irTypeParametersContainer = , fn = local fun () { { // BLOCK val tmp_0: Iterator> = .().zip(other = other.()).iterator() while (tmp_0.hasNext()) { // BLOCK val tmp_1: Pair = tmp_0.next() val thisTypeParameter: IrTypeParameter = tmp_1.component1() val otherTypeParameter: IrTypeParameter = tmp_1.component2() { // BLOCK otherTypeParameter.().mapTo>(destination = thisTypeParameter.(), transform = local fun (it: IrType): IrType { return .().remapType(type = it) } ) /*~> Unit */ } } } } ) } } interface IrDeclaration { } interface IrDeclarationParent { } interface IrType { } interface IrTypeParameter : IrDeclaration { abstract val superTypes: MutableList abstract get } interface IrTypeParametersContainer : IrDeclaration, IrDeclarationParent { abstract var typeParameters: List abstract get abstract set } interface TypeRemapper { abstract fun enterScope(irTypeParametersContainer: IrTypeParametersContainer) abstract fun leaveScope() abstract fun remapType(type: IrType): IrType } inline fun TypeRemapper.withinScope(irTypeParametersContainer: IrTypeParametersContainer, fn: Function0): T { .enterScope(irTypeParametersContainer = irTypeParametersContainer) val result: T = fn.invoke() .leaveScope() return result }