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
------------------------------------------
@@ -0,0 +1,10 @@
================ Step #1 =================
Compiling files:
src/fun1.kt
src/fun2.kt
End of files
Exit code: ABORT
------------------------------------------
COMPILATION FAILED
Conflicting overloads: public fun function(): Unit defined in test in file fun2.kt, public fun function(): Unit defined in test
@@ -0,0 +1,3 @@
package test
fun dummy() {}
@@ -0,0 +1,10 @@
================ Step #1 =================
Compiling files:
src/fun1.kt
src/fun2.kt
End of files
Exit code: ABORT
------------------------------------------
COMPILATION FAILED
Conflicting overloads: public constructor function() defined in test.function, public fun function(): Unit defined in test
@@ -0,0 +1,3 @@
package test
fun dummy() {}
@@ -0,0 +1,10 @@
================ Step #1 =================
Compiling files:
src/prop1.kt
src/prop2.kt
End of files
Exit code: ABORT
------------------------------------------
COMPILATION FAILED
Conflicting declarations: public val prop1: Int, public val prop1: Int
@@ -10,4 +10,4 @@ End of files
Exit code: ABORT
------------------------------------------
COMPILATION FAILED
Conflicting declarations: public val property: Int, public val property: Int
Conflicting declarations: public val prop1: Int, public val prop1: Int
@@ -0,0 +1,5 @@
package test
fun dummy() {
}
@@ -1,3 +1,3 @@
package test
val property = 1
val prop1 = 1
@@ -1,5 +1,3 @@
package test
fun dummy() {
}
val prop2 = 2
@@ -1,7 +1,4 @@
package test
fun dummy() {
}
val property = 1
val prop1 = 1
val prop2 = 2