[kotlinp] Fix: Forgotten sorting of KmClasses in KlibKotlinp
The declarations that are printed by the kotlinp tool may be optionally sorted. That's controlled by `sortDeclarations` flag in `org.jetbrains.kotlin.kotlinp.Settings`. However, there was no sorting implemented for `KmClass`es. This commit fixes that. ^KT-62340
This commit is contained in:
committed by
Space Team
parent
edf8dc0421
commit
d70dd7808b
@@ -38,7 +38,7 @@ class KlibKotlinp(
|
||||
appendCommentedLine("class name: ", it)
|
||||
}
|
||||
}
|
||||
moduleFragment.classes.forEach { appendLine(); renderClass(it, printer) }
|
||||
moduleFragment.classes.sortIfNeeded { it.sortedBy(KmClass::name) }.forEach { appendLine(); renderClass(it, printer) }
|
||||
moduleFragment.pkg?.let { appendLine(); renderPackage(it, printer) }
|
||||
}
|
||||
appendLine("}")
|
||||
|
||||
Reference in New Issue
Block a user