diff --git a/compiler/fir/fir-deserialization/src/org/jetbrains/kotlin/fir/deserialization/FirTypeDeserializer.kt b/compiler/fir/fir-deserialization/src/org/jetbrains/kotlin/fir/deserialization/FirTypeDeserializer.kt index 9481f496379..b4d1a2778ea 100644 --- a/compiler/fir/fir-deserialization/src/org/jetbrains/kotlin/fir/deserialization/FirTypeDeserializer.kt +++ b/compiler/fir/fir-deserialization/src/org/jetbrains/kotlin/fir/deserialization/FirTypeDeserializer.kt @@ -7,7 +7,6 @@ package org.jetbrains.kotlin.fir.deserialization import org.jetbrains.kotlin.builtins.functions.FunctionTypeKind import org.jetbrains.kotlin.fir.FirModuleData -import org.jetbrains.kotlin.fir.FirSession import org.jetbrains.kotlin.fir.computeTypeAttributes import org.jetbrains.kotlin.fir.declarations.FirDeclarationOrigin import org.jetbrains.kotlin.fir.declarations.FirResolvePhase @@ -203,22 +202,14 @@ class FirTypeDeserializer( } // TODO: Return abbreviated types for type aliases, see KT-58542 - // This condition is true when the type is precompiled for incremental compilation. - // Using the expanded type leads to the issue described in KT-28233 so we work around it by using the abbreviated type. - // The proper solution would be to mark files that depend on a changed type alias as dirty during IC. - return if (moduleData.session.kind == FirSession.Kind.Source) { - val abbreviatedTypeProto = proto.abbreviatedType(typeTable) ?: return simpleType - simpleType(abbreviatedTypeProto, attributes) - } else { - simpleType - } + return simpleType } private fun createSuspendFunctionTypeForBasicCase( functionTypeConstructor: ConeClassLikeLookupTag, arguments: Array, isNullable: Boolean, - attributes: ConeAttributes, + attributes: ConeAttributes ): ConeClassLikeType? { fun ConeClassLikeType.isContinuation(): Boolean { if (this.typeArguments.size != 1) return false diff --git a/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalFirICLightTreeJvmCompilerRunnerTestGenerated.java b/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalFirICLightTreeJvmCompilerRunnerTestGenerated.java index 30274ec4c41..3afebc2009a 100644 --- a/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalFirICLightTreeJvmCompilerRunnerTestGenerated.java +++ b/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalFirICLightTreeJvmCompilerRunnerTestGenerated.java @@ -72,11 +72,6 @@ public class IncrementalFirICLightTreeJvmCompilerRunnerTestGenerated extends Abs 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/"); diff --git a/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalFirJvmCompilerRunnerTestGenerated.java b/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalFirJvmCompilerRunnerTestGenerated.java index 516238532eb..640157caeca 100644 --- a/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalFirJvmCompilerRunnerTestGenerated.java +++ b/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalFirJvmCompilerRunnerTestGenerated.java @@ -72,11 +72,6 @@ public class IncrementalFirJvmCompilerRunnerTestGenerated extends AbstractIncrem 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/"); diff --git a/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalFirLightTreeJvmCompilerRunnerTestGenerated.java b/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalFirLightTreeJvmCompilerRunnerTestGenerated.java index 79ce2550622..12d0c1f69e5 100644 --- a/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalFirLightTreeJvmCompilerRunnerTestGenerated.java +++ b/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalFirLightTreeJvmCompilerRunnerTestGenerated.java @@ -72,11 +72,6 @@ public class IncrementalFirLightTreeJvmCompilerRunnerTestGenerated extends Abstr 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/"); diff --git a/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalJsFirKlibCompilerWithScopeExpansionRunnerTestGenerated.java b/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalJsFirKlibCompilerWithScopeExpansionRunnerTestGenerated.java index 9e9ba8a835a..57fa982ecd9 100644 --- a/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalJsFirKlibCompilerWithScopeExpansionRunnerTestGenerated.java +++ b/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalJsFirKlibCompilerWithScopeExpansionRunnerTestGenerated.java @@ -76,11 +76,6 @@ public class IncrementalJsFirKlibCompilerWithScopeExpansionRunnerTestGenerated e 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/"); @@ -921,12 +916,7 @@ public class IncrementalJsFirKlibCompilerWithScopeExpansionRunnerTestGenerated e } public void testAllFilesPresentInScopeExpansion() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/scopeExpansion"), Pattern.compile("^([^\\.]+)$"), Pattern.compile("^protectedBecomesPublicAccessedTroughChild.*"), true); - } - - @TestMetadata("changeTypeAliasAndUsage") - public void testChangeTypeAliasAndUsage() throws Exception { - runTest("jps/jps-plugin/testData/incremental/scopeExpansion/changeTypeAliasAndUsage/"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/scopeExpansion"), Pattern.compile("^([^\\.]+)$"), Pattern.compile("^(protectedBecomesPublicAccessedTroughChild|changeTypeAliasAndUsage).*"), true); } @TestMetadata("jps/jps-plugin/testData/incremental/scopeExpansion/changeTypeAliasAndUsage") @@ -938,7 +928,7 @@ public class IncrementalJsFirKlibCompilerWithScopeExpansionRunnerTestGenerated e } public void testAllFilesPresentInChangeTypeAliasAndUsage() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/scopeExpansion/changeTypeAliasAndUsage"), Pattern.compile("^([^\\.]+)$"), Pattern.compile("^protectedBecomesPublicAccessedTroughChild.*"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/scopeExpansion/changeTypeAliasAndUsage"), Pattern.compile("^([^\\.]+)$"), Pattern.compile("^(protectedBecomesPublicAccessedTroughChild|changeTypeAliasAndUsage).*"), true); } } @@ -951,7 +941,7 @@ public class IncrementalJsFirKlibCompilerWithScopeExpansionRunnerTestGenerated e } public void testAllFilesPresentInProtectedBecomesPublicAccessedTroughChild() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/scopeExpansion/protectedBecomesPublicAccessedTroughChild"), Pattern.compile("^([^\\.]+)$"), Pattern.compile("^protectedBecomesPublicAccessedTroughChild.*"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/scopeExpansion/protectedBecomesPublicAccessedTroughChild"), Pattern.compile("^([^\\.]+)$"), Pattern.compile("^(protectedBecomesPublicAccessedTroughChild|changeTypeAliasAndUsage).*"), true); } } } diff --git a/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalJsKlibCompilerWithScopeExpansionRunnerTestGenerated.java b/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalJsKlibCompilerWithScopeExpansionRunnerTestGenerated.java index 96011f390f5..e9ab2fd9528 100644 --- a/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalJsKlibCompilerWithScopeExpansionRunnerTestGenerated.java +++ b/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalJsKlibCompilerWithScopeExpansionRunnerTestGenerated.java @@ -76,11 +76,6 @@ public class IncrementalJsKlibCompilerWithScopeExpansionRunnerTestGenerated exte 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/"); diff --git a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt index cf1ab18c396..4a3d0087b36 100644 --- a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt +++ b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt @@ -138,7 +138,7 @@ fun main(args: Array) { excludedPattern = "^(secondaryConstructorAdded|withIntermediateBodiesChanged|companionObjectNameChanged).*") model("incremental/js", extension = null, excludeParentDirs = true) model("incremental/scopeExpansion", extension = null, excludeParentDirs = true, - excludedPattern = "^protectedBecomesPublicAccessedTroughChild.*") + excludedPattern = "^(protectedBecomesPublicAccessedTroughChild|changeTypeAliasAndUsage).*") } testClass { diff --git a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/IncrementalK2FirICLightTreeJvmJpsTestGenerated.java b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/IncrementalK2FirICLightTreeJvmJpsTestGenerated.java index 86f89b7c30a..e7f3657adfa 100644 --- a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/IncrementalK2FirICLightTreeJvmJpsTestGenerated.java +++ b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/IncrementalK2FirICLightTreeJvmJpsTestGenerated.java @@ -77,11 +77,6 @@ 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/"); diff --git a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/IncrementalK2JvmJpsTestGenerated.java b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/IncrementalK2JvmJpsTestGenerated.java index 0f67bd5ff78..a9c57410c86 100644 --- a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/IncrementalK2JvmJpsTestGenerated.java +++ b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/IncrementalK2JvmJpsTestGenerated.java @@ -77,11 +77,6 @@ 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/"); diff --git a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/IncrementalK2LightTreeJvmJpsTestGenerated.java b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/IncrementalK2LightTreeJvmJpsTestGenerated.java index 4ffb9049b8a..eedd5a598c8 100644 --- a/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/IncrementalK2LightTreeJvmJpsTestGenerated.java +++ b/jps/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/IncrementalK2LightTreeJvmJpsTestGenerated.java @@ -77,11 +77,6 @@ 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/"); diff --git a/jps/jps-plugin/testData/incremental/pureKotlin/changeTypealiasSinceK2/Foo.kt b/jps/jps-plugin/testData/incremental/pureKotlin/changeTypealiasSinceK2/Foo.kt deleted file mode 100644 index eb46da437ea..00000000000 --- a/jps/jps-plugin/testData/incremental/pureKotlin/changeTypealiasSinceK2/Foo.kt +++ /dev/null @@ -1,3 +0,0 @@ -interface Foo { - val values: Type -} \ No newline at end of file diff --git a/jps/jps-plugin/testData/incremental/pureKotlin/changeTypealiasSinceK2/FooImpl.kt b/jps/jps-plugin/testData/incremental/pureKotlin/changeTypealiasSinceK2/FooImpl.kt deleted file mode 100644 index f69bf70f681..00000000000 --- a/jps/jps-plugin/testData/incremental/pureKotlin/changeTypealiasSinceK2/FooImpl.kt +++ /dev/null @@ -1,4 +0,0 @@ -class FooImpl : Foo { - override val values: Type - get() = "0" -} \ No newline at end of file diff --git a/jps/jps-plugin/testData/incremental/pureKotlin/changeTypealiasSinceK2/FooImpl.kt.new.1 b/jps/jps-plugin/testData/incremental/pureKotlin/changeTypealiasSinceK2/FooImpl.kt.new.1 deleted file mode 100644 index 31af1919a86..00000000000 --- a/jps/jps-plugin/testData/incremental/pureKotlin/changeTypealiasSinceK2/FooImpl.kt.new.1 +++ /dev/null @@ -1,4 +0,0 @@ -class FooImpl : Foo { - override val values: Type - get() = 0 -} \ No newline at end of file diff --git a/jps/jps-plugin/testData/incremental/pureKotlin/changeTypealiasSinceK2/build.log b/jps/jps-plugin/testData/incremental/pureKotlin/changeTypealiasSinceK2/build.log deleted file mode 100644 index b09b6e2d1e4..00000000000 --- a/jps/jps-plugin/testData/incremental/pureKotlin/changeTypealiasSinceK2/build.log +++ /dev/null @@ -1,35 +0,0 @@ -================ 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 ------------------------------------------- \ No newline at end of file diff --git a/jps/jps-plugin/testData/incremental/pureKotlin/changeTypealiasSinceK2/types.kt b/jps/jps-plugin/testData/incremental/pureKotlin/changeTypealiasSinceK2/types.kt deleted file mode 100644 index f5d41f3b85d..00000000000 --- a/jps/jps-plugin/testData/incremental/pureKotlin/changeTypealiasSinceK2/types.kt +++ /dev/null @@ -1 +0,0 @@ -typealias Type = String \ No newline at end of file diff --git a/jps/jps-plugin/testData/incremental/pureKotlin/changeTypealiasSinceK2/types.kt.new.1 b/jps/jps-plugin/testData/incremental/pureKotlin/changeTypealiasSinceK2/types.kt.new.1 deleted file mode 100644 index 264a293ffcf..00000000000 --- a/jps/jps-plugin/testData/incremental/pureKotlin/changeTypealiasSinceK2/types.kt.new.1 +++ /dev/null @@ -1 +0,0 @@ -typealias Type = Int \ No newline at end of file