[FIR] Implement EXPECT_AND_ACTUAL_IN_THE_SAME_MODULE
^KT-60367 Fixed KT review: https://jetbrains.team/p/kt/reviews/14064/timeline IJ review: https://jetbrains.team/p/ij/reviews/124657/timeline
This commit is contained in:
+7
@@ -3042,6 +3042,13 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirErrors.EXPECT_AND_ACTUAL_IN_THE_SAME_MODULE) { firDiagnostic ->
|
||||
ExpectAndActualInTheSameModuleImpl(
|
||||
firSymbolBuilder.buildSymbol(firDiagnostic.a),
|
||||
firDiagnostic as KtPsiDiagnostic,
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirErrors.METHOD_OF_ANY_IMPLEMENTED_IN_INTERFACE) { firDiagnostic ->
|
||||
MethodOfAnyImplementedInInterfaceImpl(
|
||||
firDiagnostic as KtPsiDiagnostic,
|
||||
|
||||
+5
@@ -2151,6 +2151,11 @@ sealed interface KtFirDiagnostic<PSI : PsiElement> : KtDiagnosticWithPsi<PSI> {
|
||||
val conflictingDeclarations: List<KtSymbol>
|
||||
}
|
||||
|
||||
interface ExpectAndActualInTheSameModule : KtFirDiagnostic<KtNamedDeclaration> {
|
||||
override val diagnosticClass get() = ExpectAndActualInTheSameModule::class
|
||||
val declaration: KtSymbol
|
||||
}
|
||||
|
||||
interface MethodOfAnyImplementedInInterface : KtFirDiagnostic<PsiElement> {
|
||||
override val diagnosticClass get() = MethodOfAnyImplementedInInterface::class
|
||||
}
|
||||
|
||||
+6
@@ -2577,6 +2577,12 @@ internal class PackageOrClassifierRedeclarationImpl(
|
||||
token: KtLifetimeToken,
|
||||
) : KtAbstractFirDiagnostic<KtNamedDeclaration>(firDiagnostic, token), KtFirDiagnostic.PackageOrClassifierRedeclaration
|
||||
|
||||
internal class ExpectAndActualInTheSameModuleImpl(
|
||||
override val declaration: KtSymbol,
|
||||
firDiagnostic: KtPsiDiagnostic,
|
||||
token: KtLifetimeToken,
|
||||
) : KtAbstractFirDiagnostic<KtNamedDeclaration>(firDiagnostic, token), KtFirDiagnostic.ExpectAndActualInTheSameModule
|
||||
|
||||
internal class MethodOfAnyImplementedInInterfaceImpl(
|
||||
firDiagnostic: KtPsiDiagnostic,
|
||||
token: KtLifetimeToken,
|
||||
|
||||
+18
@@ -24854,6 +24854,24 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/expectActualClassesAreInBeta_suppressWarningWithLv.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("expectActualInTheSameModule.kt")
|
||||
public void testExpectActualInTheSameModule() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/expectActualInTheSameModule.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("expectActualInTheSameModuleDifferentFiles.kt")
|
||||
public void testExpectActualInTheSameModuleDifferentFiles() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/expectActualInTheSameModuleDifferentFiles.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("expectActualMainInTheSameModuleDifferentFiles.kt")
|
||||
public void testExpectActualMainInTheSameModuleDifferentFiles() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/expectActualMainInTheSameModuleDifferentFiles.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("expectDataObject.kt")
|
||||
public void testExpectDataObject() throws Exception {
|
||||
|
||||
+18
@@ -24854,6 +24854,24 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/expectActualClassesAreInBeta_suppressWarningWithLv.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("expectActualInTheSameModule.kt")
|
||||
public void testExpectActualInTheSameModule() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/expectActualInTheSameModule.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("expectActualInTheSameModuleDifferentFiles.kt")
|
||||
public void testExpectActualInTheSameModuleDifferentFiles() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/expectActualInTheSameModuleDifferentFiles.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("expectActualMainInTheSameModuleDifferentFiles.kt")
|
||||
public void testExpectActualMainInTheSameModuleDifferentFiles() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/expectActualMainInTheSameModuleDifferentFiles.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("expectDataObject.kt")
|
||||
public void testExpectDataObject() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user