[Commonizer] Use kotlin/Any as the default supertype for commonized class
This commit is contained in:
+7
-3
@@ -148,11 +148,15 @@ internal class CommonizationVisitor(
|
|||||||
classId: ClassId,
|
classId: ClassId,
|
||||||
supertypesMap: Map<CirType, CommonizedGroup<CirType>>?
|
supertypesMap: Map<CirType, CommonizedGroup<CirType>>?
|
||||||
) {
|
) {
|
||||||
|
val commonSupertypes = supertypesMap?.values?.compactMapNotNull { supertypesGroup ->
|
||||||
|
commonize(supertypesGroup, TypeCommonizer(classifiers))
|
||||||
|
}.orEmpty()
|
||||||
|
|
||||||
setSupertypes(
|
setSupertypes(
|
||||||
if (supertypesMap.isNullOrEmpty())
|
if (commonSupertypes.isEmpty() && classId !in SPECIAL_CLASS_WITHOUT_SUPERTYPES_CIDS)
|
||||||
if (classId in SPECIAL_CLASS_WITHOUT_SUPERTYPES_CIDS) emptyList() else listOf(CirTypeFactory.StandardTypes.ANY)
|
listOf(CirTypeFactory.StandardTypes.ANY)
|
||||||
else
|
else
|
||||||
supertypesMap.values.compactMapNotNull { supertypesGroup -> commonize(supertypesGroup, TypeCommonizer(classifiers)) }
|
commonSupertypes
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user