IR: make IrTypeParameter.superTypes persistent mutable field
This commit is contained in:
@@ -224,8 +224,8 @@ private fun IrTypeParameter.copySuperTypesFrom(source: IrTypeParameter, srcToDst
|
||||
val target = this
|
||||
val sourceParent = source.parent as IrTypeParametersContainer
|
||||
val targetParent = target.parent as IrTypeParametersContainer
|
||||
source.superTypes.forEach {
|
||||
target.superTypes.add(it.remapTypeParameters(sourceParent, targetParent, srcToDstParameterMap))
|
||||
target.superTypes += source.superTypes.map {
|
||||
it.remapTypeParameters(sourceParent, targetParent, srcToDstParameterMap)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -526,7 +526,7 @@ fun IrFactory.createStaticFunctionWithReceivers(
|
||||
fun remap(type: IrType): IrType =
|
||||
type.remapTypeParameters(oldFunction, this, typeParameterMap)
|
||||
|
||||
typeParameters.forEach { it.superTypes.replaceAll { remap(it) } }
|
||||
typeParameters.forEach { it.superTypes = it.superTypes.map(::remap) }
|
||||
|
||||
annotations = oldFunction.annotations
|
||||
|
||||
|
||||
+1
-1
@@ -610,7 +610,7 @@ class LocalDeclarationsLowering(
|
||||
newDeclaration.copyTypeParametersFrom(oldDeclaration, parameterMap = localFunctionContext.capturedTypeParameterToTypeParameter)
|
||||
// Type parameters of oldDeclaration may depend on captured type parameters, so deal with that after copying.
|
||||
newDeclaration.typeParameters.drop(newTypeParameters.size).forEach { tp ->
|
||||
tp.superTypes.replaceAll { localFunctionContext.remapType(it) }
|
||||
tp.superTypes = tp.superTypes.map { localFunctionContext.remapType(it) }
|
||||
}
|
||||
|
||||
newDeclaration.parent = memberOwner
|
||||
|
||||
+1
-1
@@ -291,7 +291,7 @@ internal fun IrFactory.buildTypeParameter(builder: IrTypeParameterBuilder, paren
|
||||
name, index, isReified, variance
|
||||
).also {
|
||||
wrappedDescriptor.bind(it)
|
||||
it.superTypes.addAll(superTypes)
|
||||
it.superTypes = superTypes
|
||||
it.parent = parent
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user