Remove dirty output files when expanding IC scope early
Previously IC could go to the next iteration without removing
outputs for the files compiled during the last iteration.
For example, it could happen, when a multifile part is changed
(we add sources for other parts and recompile everything together).
In case of MPP it could lead to compile error, because
the compiler would see the same actual declarations from dirty sources
and dirty outputs from previous iteration (which should have been removed).
That behaviour did not raise an error before dc8240c24e
because actual declarations from binaries (e.g. compile classpath) were ignored.
#KT-35957 Fixed
This commit is contained in:
+1
@@ -246,6 +246,7 @@ abstract class IncrementalCompilerRunner<
|
||||
val additionalDirtyFiles = additionalDirtyFiles(caches, generatedFiles, services).filter { it !in dirtySourcesSet }
|
||||
if (additionalDirtyFiles.isNotEmpty()) {
|
||||
dirtySources.addAll(additionalDirtyFiles)
|
||||
generatedFiles.forEach { it.outputFile.delete() }
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,9 +6,4 @@ Compiling files:
|
||||
src/utilsActual.kt
|
||||
src/utilsNoActual.kt
|
||||
End of files
|
||||
Exit code: ABORT
|
||||
------------------------------------------
|
||||
COMPILATION FAILED
|
||||
Class 'X' has several compatible actual declarations in modules <multifilePartChanged>, <multifilePartChanged>
|
||||
Function 'foo' has several compatible actual declarations in modules <multifilePartChanged>, <multifilePartChanged>
|
||||
Function 'useX' has several compatible actual declarations in modules <multifilePartChanged>, <multifilePartChanged>
|
||||
Exit code: OK
|
||||
Reference in New Issue
Block a user