[IR] Fix file modules after actualization

When files from different IrModules are merged in IrActualizer
their IrModule link was not updated. This led to assuming them
as different modules, and incorrect internal visibility handling.

^KT-62623
This commit is contained in:
Pavel Kunyavskiy
2023-10-16 17:17:00 +02:00
committed by Space Team
parent ad5831acc6
commit da488f513f
19 changed files with 151 additions and 1 deletions
@@ -119,7 +119,9 @@ object IrActualizer {
}
private fun mergeIrFragments(mainFragment: IrModuleFragment, dependentFragments: List<IrModuleFragment>) {
mainFragment.files.addAll(0, dependentFragments.flatMap { it.files })
val newFiles = dependentFragments.flatMap { it.files }
for (file in newFiles) file.module = mainFragment
mainFragment.files.addAll(0, newFiles)
}
}