Created a deep copier good for fake overrides.

Adapted it from inliner copier.
It is capable of producing type substituted members.
This commit is contained in:
Alexander Gorshenev
2020-05-12 13:26:47 +03:00
parent 63429c088f
commit 789efc7c3a
5 changed files with 200 additions and 11 deletions
@@ -21,7 +21,6 @@ import org.jetbrains.kotlin.ir.visitors.acceptVoid
import org.jetbrains.kotlin.name.Name
internal class DeepCopyIrTreeWithSymbolsForInliner(
val context: CommonBackendContext,
val typeArguments: Map<IrTypeParameterSymbol, IrType?>?,
val parent: IrDeclarationParent?
) {
@@ -120,7 +120,7 @@ class FunctionInlining(
(0 until callSite.typeArgumentsCount).map {
typeParameters[it].symbol to callSite.getTypeArgument(it)
}.associate { it }
DeepCopyIrTreeWithSymbolsForInliner(context, typeArguments, parent)
DeepCopyIrTreeWithSymbolsForInliner(typeArguments, parent)
}
val substituteMap = mutableMapOf<IrValueParameter, IrExpression>()