[K2, MPP] Fix NO_ACTUAL_FOR_EXPECT reporting for all modules including the platform ones

^KT-58483 Fixed
This commit is contained in:
Ivan Kochurkin
2023-06-13 16:46:07 +02:00
committed by Space Team
parent 4f92008f01
commit f4a648aa3e
25 changed files with 141 additions and 61 deletions
@@ -62,6 +62,10 @@ internal class ExpectActualCollector(
) {
val linkCollector = ExpectActualLinkCollector(destination, classActualizationInfo, typeSystemContext, diagnosticsReporter)
dependentFragments.forEach { linkCollector.visitModuleFragment(it) }
// It doesn't make sense to link expects from the last module because actuals always should be located in another module
// Thus relevant actuals are always missing for the last module
// But the collector should be run anyway to detect and report "hanging" expect declarations
linkCollector.visitModuleFragment(mainFragment)
}
}
@@ -77,6 +81,8 @@ internal data class ClassActualizationInfo(
}
}
private class ActualDeclarationsCollector {
companion object {
fun collectActualsFromFragments(fragments: List<IrModuleFragment>): ClassActualizationInfo {