Add test for IC issue with typealias
If typealias is defined in a separate file, then after changing some base types, an incremental compilation of Kotlin could not find all affected files, because of lack of information, which it can not get on the class file analyzing phase. FIR provides a new approach to IC compilation: now we can run the frontend several times, which allows us to obtain all necessary information and use it to mark all affected files for recompilation. Relates to KT-54991 #KT-28233 Fixed
This commit is contained in:
committed by
Space Team
parent
25668ddd01
commit
848e1001f8
@@ -45,7 +45,13 @@ fun main(args: Array<String>) {
|
||||
"incremental/multiModule/multiplatform/custom", extension = null, excludeParentDirs = true,
|
||||
targetBackend = TargetBackend.JVM_IR
|
||||
)
|
||||
model("incremental/pureKotlin", extension = null, recursive = false, targetBackend = TargetBackend.JVM_IR)
|
||||
model(
|
||||
"incremental/pureKotlin",
|
||||
extension = null,
|
||||
recursive = false,
|
||||
targetBackend = TargetBackend.JVM_IR,
|
||||
excludedPattern = ".*SinceK2"
|
||||
)
|
||||
model("incremental/withJava", extension = null, excludeParentDirs = true, targetBackend = TargetBackend.JVM_IR)
|
||||
model("incremental/inlineFunCallSite", extension = null, excludeParentDirs = true, targetBackend = TargetBackend.JVM_IR)
|
||||
model(
|
||||
|
||||
Generated
+1
-1
@@ -733,7 +733,7 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInPureKotlin() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/pureKotlin"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, false);
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/pureKotlin"), Pattern.compile("^([^\\.]+)$"), Pattern.compile(".*SinceK2"), TargetBackend.JVM_IR, false);
|
||||
}
|
||||
|
||||
@TestMetadata("annotations")
|
||||
|
||||
+5
@@ -82,6 +82,11 @@ public class IncrementalK2FirICLightTreeJvmJpsTestGenerated extends AbstractIncr
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/changeTypeImplicitlyWithCircularDependency/");
|
||||
}
|
||||
|
||||
@TestMetadata("changeTypealiasSinceK2")
|
||||
public void testChangeTypealiasSinceK2() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/changeTypealiasSinceK2/");
|
||||
}
|
||||
|
||||
@TestMetadata("changeWithRemovingUsage")
|
||||
public void testChangeWithRemovingUsage() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/changeWithRemovingUsage/");
|
||||
|
||||
Generated
+5
@@ -82,6 +82,11 @@ public class IncrementalK2JvmJpsTestGenerated extends AbstractIncrementalK2JvmJp
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/changeTypeImplicitlyWithCircularDependency/");
|
||||
}
|
||||
|
||||
@TestMetadata("changeTypealiasSinceK2")
|
||||
public void testChangeTypealiasSinceK2() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/changeTypealiasSinceK2/");
|
||||
}
|
||||
|
||||
@TestMetadata("changeWithRemovingUsage")
|
||||
public void testChangeWithRemovingUsage() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/changeWithRemovingUsage/");
|
||||
|
||||
+5
@@ -82,6 +82,11 @@ public class IncrementalK2LightTreeJvmJpsTestGenerated extends AbstractIncrement
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/changeTypeImplicitlyWithCircularDependency/");
|
||||
}
|
||||
|
||||
@TestMetadata("changeTypealiasSinceK2")
|
||||
public void testChangeTypealiasSinceK2() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/changeTypealiasSinceK2/");
|
||||
}
|
||||
|
||||
@TestMetadata("changeWithRemovingUsage")
|
||||
public void testChangeWithRemovingUsage() throws Exception {
|
||||
runTest("jps/jps-plugin/testData/incremental/pureKotlin/changeWithRemovingUsage/");
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
interface Foo {
|
||||
val values: Type
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
class FooImpl : Foo {
|
||||
override val values: Type
|
||||
get() = "0"
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
class FooImpl : Foo {
|
||||
override val values: Type
|
||||
get() = 0
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
================ Step #1 =================
|
||||
|
||||
Cleaning output files:
|
||||
out/production/module/FooImpl.class
|
||||
out/production/module/META-INF/module.kotlin_module
|
||||
out/production/module/TypesKt.class
|
||||
End of files
|
||||
Compiling files:
|
||||
src/FooImpl.kt
|
||||
src/types.kt
|
||||
End of files
|
||||
After build round. Marked as dirty by Kotlin:
|
||||
src/Foo.kt
|
||||
Exit code: ADDITIONAL_PASS_REQUIRED
|
||||
------------------------------------------
|
||||
Cleaning output files:
|
||||
out/production/module/Foo.class
|
||||
out/production/module/META-INF/module.kotlin_module
|
||||
End of files
|
||||
Compiling files:
|
||||
src/Foo.kt
|
||||
End of files
|
||||
After build round. Marked as dirty by Kotlin:
|
||||
src/FooImpl.kt
|
||||
Exit code: ADDITIONAL_PASS_REQUIRED
|
||||
------------------------------------------
|
||||
Cleaning output files:
|
||||
out/production/module/FooImpl.class
|
||||
out/production/module/META-INF/module.kotlin_module
|
||||
End of files
|
||||
Compiling files:
|
||||
src/FooImpl.kt
|
||||
End of files
|
||||
Exit code: OK
|
||||
------------------------------------------
|
||||
+1
@@ -0,0 +1 @@
|
||||
typealias Type = String
|
||||
+1
@@ -0,0 +1 @@
|
||||
typealias Type = Int
|
||||
Reference in New Issue
Block a user