Expand compilation scope for IC before backend is run

Sometimes IC raises compilation errors when rebuild succeeds.
This happens because IC uses serialized decriptors
for non-dirty files. Serialized descriptors can be different
from source file descriptors. For example, a source file
may contain an implicit return type or an implicit visibility
for overridden methods, but serialized descriptors always
contain explicit return types & methods' visibilities.

These problems can be solved by expanding a scope of incremental compilation
just after the analysis, but before error reporting & code generation.
In other words, we need to compare descriptors before error reporting and code generation.
If there are new dirty files, current round of IC must be aborted,
next round must be performed with new dirty files.

This commit implements IC scope expansion for JS Klib compiler

    #KT-13677
    #KT-28233
This commit is contained in:
Alexey Tsvetkov
2019-08-23 07:49:20 +03:00
parent 4f3418dc89
commit 2d598d50d7
28 changed files with 1205 additions and 67 deletions
@@ -0,0 +1,22 @@
================ Step #1 =================
Compiling files:
src/Enum.kt
src/getRandomEnumEntry.kt
src/use.kt
src/useEnumImplicitly.kt
End of files
Exit code: ABORT
------------------------------------------
COMPILATION FAILED
Unresolved reference: C
================ Step #2 =================
Compiling files:
src/Enum.kt
src/getRandomEnumEntry.kt
src/use.kt
src/useEnumImplicitly.kt
End of files
Exit code: OK
@@ -0,0 +1,26 @@
================ Step #1 =================
Compiling files:
src/A.kt
src/AChild.kt
src/AConstructorFunction.kt
src/createAFromInt.kt
src/createAFromString.kt
src/useA.kt
End of files
Exit code: ABORT
------------------------------------------
COMPILATION FAILED
Conflicting overloads: public constructor A(x: String) defined in A, public fun A(x: String): A defined in root package
================ Step #2 =================
Compiling files:
src/A.kt
src/AChild.kt
src/createAFromInt.kt
src/createAFromString.kt
src/useA.kt
End of files
Exit code: OK
------------------------------------------