[FIR] Revert workaround for IC issue surfaced by KT-58335

#KT-28233
This commit is contained in:
Kirill Rakhman
2023-05-11 17:42:43 +02:00
committed by Space Team
parent 878dd67d92
commit a50ae9db9d
16 changed files with 6 additions and 108 deletions
@@ -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<ConeTypeProjection>,
isNullable: Boolean,
attributes: ConeAttributes,
attributes: ConeAttributes
): ConeClassLikeType? {
fun ConeClassLikeType.isContinuation(): Boolean {
if (this.typeArguments.size != 1) return false
@@ -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/");
@@ -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/");
@@ -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/");
@@ -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);
}
}
}
@@ -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/");