Add assertion for overwriting common sources flag
Wrong flag state causes compilation errors for optional expectation (this flag is used to pass -Xcommon-sources)
This commit is contained in:
@@ -49,7 +49,14 @@ class KotlinDirtySourceFilesHolder(
|
|||||||
* and during KotlinDirtySourceFilesHolder initialization.
|
* and during KotlinDirtySourceFilesHolder initialization.
|
||||||
*/
|
*/
|
||||||
internal fun _markDirty(file: File, root: JavaSourceRootDescriptor) {
|
internal fun _markDirty(file: File, root: JavaSourceRootDescriptor) {
|
||||||
_dirty[file.canonicalFile] = KotlinModuleBuildTarget.Source(file, root is KotlinIncludedModuleSourceRoot)
|
val isCrossCompiled = root is KotlinIncludedModuleSourceRoot
|
||||||
|
val old = _dirty.put(file.canonicalFile, KotlinModuleBuildTarget.Source(file, isCrossCompiled))
|
||||||
|
|
||||||
|
check(old == null || old.isCrossCompiled == isCrossCompiled) {
|
||||||
|
"`${file.canonicalFile}` already marked as dirty: " +
|
||||||
|
"old is cross compiled: ${old!!.isCrossCompiled}, " +
|
||||||
|
"new is cross compiled: $isCrossCompiled"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user