[Commonizer] Preserve order of supertypes in commonized class
This commit is contained in:
+3
-3
@@ -8,7 +8,7 @@ package org.jetbrains.kotlin.descriptors.commonizer.core
|
||||
import org.jetbrains.kotlin.descriptors.commonizer.cir.CirType
|
||||
import org.jetbrains.kotlin.descriptors.commonizer.cir.CirTypeSignature
|
||||
import org.jetbrains.kotlin.descriptors.commonizer.mergedtree.*
|
||||
import org.jetbrains.kotlin.descriptors.commonizer.utils.CommonizedGroupMap
|
||||
import org.jetbrains.kotlin.descriptors.commonizer.utils.CommonizedGroup
|
||||
import org.jetbrains.kotlin.descriptors.commonizer.utils.internedClassId
|
||||
|
||||
internal class CommonizationVisitor(
|
||||
@@ -93,10 +93,10 @@ internal class CommonizationVisitor(
|
||||
}
|
||||
|
||||
// find out common (and commonized) supertypes
|
||||
val supertypesMap = CommonizedGroupMap<CirTypeSignature, CirType>(node.targetDeclarations.size)
|
||||
val supertypesMap: MutableMap<CirTypeSignature, CommonizedGroup<CirType>> = linkedMapOf() // preserve supertype order
|
||||
node.targetDeclarations.forEachIndexed { index, clazz ->
|
||||
for (supertype in clazz!!.supertypes) {
|
||||
supertypesMap[supertype.signature][index] = supertype
|
||||
supertypesMap.getOrPut(supertype.signature) { CommonizedGroup(node.targetDeclarations.size) }[index] = supertype
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user