IR: make IrTypeParameter.superTypes persistent mutable field
This commit is contained in:
@@ -31,7 +31,7 @@ abstract class IrTypeParameter : IrDeclarationBase(), IrSymbolDeclaration<IrType
|
||||
abstract val variance: Variance
|
||||
abstract val index: Int
|
||||
abstract val isReified: Boolean
|
||||
abstract val superTypes: MutableList<IrType>
|
||||
abstract var superTypes: List<IrType>
|
||||
|
||||
override fun <R, D> accept(visitor: IrElementVisitor<R, D>, data: D): R =
|
||||
visitor.visitTypeParameter(this, data)
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ class IrLazyTypeParameter(
|
||||
|
||||
override var annotations: List<IrConstructorCall> by createLazyAnnotations()
|
||||
|
||||
override val superTypes: MutableList<IrType> by lazy {
|
||||
override var superTypes: List<IrType> by lazyVar {
|
||||
withInitialIr {
|
||||
typeTranslator.buildWithScope(this.parent as IrTypeParametersContainer) {
|
||||
val descriptor = symbol.descriptor
|
||||
|
||||
@@ -308,7 +308,7 @@ open class DeepCopyIrTreeWithSymbols(
|
||||
override fun visitTypeParameter(declaration: IrTypeParameter): IrTypeParameter =
|
||||
copyTypeParameter(declaration).apply {
|
||||
// TODO type parameter scopes?
|
||||
declaration.superTypes.mapTo(superTypes) { it.remapType() }
|
||||
superTypes = declaration.superTypes.map { it.remapType() }
|
||||
}
|
||||
|
||||
private fun copyTypeParameter(declaration: IrTypeParameter): IrTypeParameter =
|
||||
@@ -331,7 +331,7 @@ open class DeepCopyIrTreeWithSymbols(
|
||||
|
||||
typeRemapper.withinScope(this) {
|
||||
for ((thisTypeParameter, otherTypeParameter) in this.typeParameters.zip(other.typeParameters)) {
|
||||
otherTypeParameter.superTypes.mapTo(thisTypeParameter.superTypes) {
|
||||
thisTypeParameter.superTypes = otherTypeParameter.superTypes.map {
|
||||
typeRemapper.remapType(it)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user