[FIR] Rewrite redeclaration checks
#KT-60124 Fixed #KT-60573 Fixed
This commit is contained in:
committed by
Space Team
parent
b56f84b533
commit
951b299268
+7
@@ -19,11 +19,14 @@ import org.jetbrains.kotlin.fir.analysis.FirOverridesBackwardCompatibilityHelper
|
||||
import org.jetbrains.kotlin.fir.analysis.checkers.FirPlatformDiagnosticSuppressor
|
||||
import org.jetbrains.kotlin.fir.analysis.js.checkers.FirJsPlatformDiagnosticSuppressor
|
||||
import org.jetbrains.kotlin.fir.analysis.jvm.FirJvmOverridesBackwardCompatibilityHelper
|
||||
import org.jetbrains.kotlin.fir.declarations.FirTypeSpecificityComparatorProvider
|
||||
import org.jetbrains.kotlin.fir.resolve.calls.ConeCallConflictResolverFactory
|
||||
import org.jetbrains.kotlin.fir.resolve.providers.FirSymbolProvider
|
||||
import org.jetbrains.kotlin.fir.scopes.FirKotlinScopeProvider
|
||||
import org.jetbrains.kotlin.fir.scopes.FirPlatformClassMapper
|
||||
import org.jetbrains.kotlin.fir.session.JsCallConflictResolverFactory
|
||||
import org.jetbrains.kotlin.fir.types.typeContext
|
||||
import org.jetbrains.kotlin.js.resolve.JsTypeSpecificityComparatorWithoutDelegate
|
||||
|
||||
@OptIn(SessionConfiguration::class)
|
||||
internal class LLFirJsSessionFactory(project: Project) : LLFirAbstractSessionFactory(project) {
|
||||
@@ -83,6 +86,10 @@ internal class LLFirJsSessionFactory(project: Project) : LLFirAbstractSessionFac
|
||||
private fun LLFirSession.registerModuleIndependentJsComponents() {
|
||||
register(FirVisibilityChecker::class, FirVisibilityChecker.Default)
|
||||
register(ConeCallConflictResolverFactory::class, JsCallConflictResolverFactory)
|
||||
register(
|
||||
FirTypeSpecificityComparatorProvider::class,
|
||||
FirTypeSpecificityComparatorProvider(JsTypeSpecificityComparatorWithoutDelegate(typeContext))
|
||||
)
|
||||
register(FirPlatformClassMapper::class, FirPlatformClassMapper.Default)
|
||||
register(FirOverridesBackwardCompatibilityHelper::class, FirJvmOverridesBackwardCompatibilityHelper)
|
||||
register(FirPlatformDiagnosticSuppressor::class, FirJsPlatformDiagnosticSuppressor())
|
||||
|
||||
+6
-30
@@ -25967,39 +25967,15 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("RedeclarationMainInMultiFile.kt")
|
||||
public void testRedeclarationMainInMultiFile() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/redeclarations/RedeclarationMainInMultiFile.kt");
|
||||
@TestMetadata("RedeclarationOfMain.kt")
|
||||
public void testRedeclarationOfMain() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/redeclarations/RedeclarationOfMain.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("RedeclarationParameterlessMain.kt")
|
||||
public void testRedeclarationParameterlessMain() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/redeclarations/RedeclarationParameterlessMain.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("RedeclarationParameterlessMainInvalid.kt")
|
||||
public void testRedeclarationParameterlessMainInvalid() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/redeclarations/RedeclarationParameterlessMainInvalid.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("RedeclarationParameterlessMain_before.kt")
|
||||
public void testRedeclarationParameterlessMain_before() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/redeclarations/RedeclarationParameterlessMain_before.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("RedeclarationSuspendMainInMultiFile.kt")
|
||||
public void testRedeclarationSuspendMainInMultiFile() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/redeclarations/RedeclarationSuspendMainInMultiFile.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("RedeclarationSuspendMainInMultiFile_before.kt")
|
||||
public void testRedeclarationSuspendMainInMultiFile_before() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/redeclarations/RedeclarationSuspendMainInMultiFile_before.kt");
|
||||
@TestMetadata("RedeclarationOfMain_before.kt")
|
||||
public void testRedeclarationOfMain_before() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/redeclarations/RedeclarationOfMain_before.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
+6
-30
@@ -25967,39 +25967,15 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("RedeclarationMainInMultiFile.kt")
|
||||
public void testRedeclarationMainInMultiFile() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/redeclarations/RedeclarationMainInMultiFile.kt");
|
||||
@TestMetadata("RedeclarationOfMain.kt")
|
||||
public void testRedeclarationOfMain() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/redeclarations/RedeclarationOfMain.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("RedeclarationParameterlessMain.kt")
|
||||
public void testRedeclarationParameterlessMain() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/redeclarations/RedeclarationParameterlessMain.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("RedeclarationParameterlessMainInvalid.kt")
|
||||
public void testRedeclarationParameterlessMainInvalid() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/redeclarations/RedeclarationParameterlessMainInvalid.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("RedeclarationParameterlessMain_before.kt")
|
||||
public void testRedeclarationParameterlessMain_before() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/redeclarations/RedeclarationParameterlessMain_before.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("RedeclarationSuspendMainInMultiFile.kt")
|
||||
public void testRedeclarationSuspendMainInMultiFile() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/redeclarations/RedeclarationSuspendMainInMultiFile.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("RedeclarationSuspendMainInMultiFile_before.kt")
|
||||
public void testRedeclarationSuspendMainInMultiFile_before() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/redeclarations/RedeclarationSuspendMainInMultiFile_before.kt");
|
||||
@TestMetadata("RedeclarationOfMain_before.kt")
|
||||
public void testRedeclarationOfMain_before() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/redeclarations/RedeclarationOfMain_before.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user