[FIR] Do not sort declarations in deserialized classes, keep order from metadata
KT-57769 KT-54792
This commit is contained in:
committed by
Space Team
parent
839026b6fe
commit
7685284cb7
-10
@@ -203,16 +203,6 @@ fun deserializeClassToSymbol(
|
||||
configure(classId)
|
||||
}
|
||||
|
||||
declarations.sortWith(object : Comparator<FirDeclaration> {
|
||||
override fun compare(a: FirDeclaration, b: FirDeclaration): Int {
|
||||
// Reorder members based on their type and name only.
|
||||
// See FE 1.0's [DeserializedMemberScope#addMembers].
|
||||
if (a is FirMemberDeclaration && b is FirMemberDeclaration) {
|
||||
return FirMemberDeclarationComparator.TypeAndNameComparator.compare(a, b)
|
||||
}
|
||||
return 0
|
||||
}
|
||||
})
|
||||
companionObjectSymbol = (declarations.firstOrNull { it is FirRegularClass && it.isCompanion } as FirRegularClass?)?.symbol
|
||||
|
||||
contextReceivers.addAll(classDeserializer.createContextReceiversForClass(classProto))
|
||||
|
||||
Reference in New Issue
Block a user