[FIR] Switch FirExpectActualDeclarationChecker to Platform checker
^KT-66028 Fixed
This commit is contained in:
+24
@@ -1729,6 +1729,18 @@ public class FirOldFrontendMPPDiagnosticsWithLightTreeTestGenerated extends Abst
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/multiplatform/hmpp")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class Hmpp {
|
||||
@Test
|
||||
@TestMetadata("actualizeSubtypeBeforeSupertype.kt")
|
||||
public void testActualizeSubtypeBeforeSupertype() {
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/hmpp/actualizeSubtypeBeforeSupertype.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("actualizedInPlatformSession.kt")
|
||||
public void testActualizedInPlatformSession() {
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/hmpp/actualizedInPlatformSession.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAllFilesPresentInHmpp() {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/multiplatform/hmpp"), Pattern.compile("^(.*)\\.kts?$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), TargetBackend.JVM_IR, true);
|
||||
@@ -1740,6 +1752,12 @@ public class FirOldFrontendMPPDiagnosticsWithLightTreeTestGenerated extends Abst
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/hmpp/ambiguousActuals.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("hmppModalityClash.kt")
|
||||
public void testHmppModalityClash() {
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/hmpp/hmppModalityClash.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("hmppRedeclaration.kt")
|
||||
public void testHmppRedeclaration() {
|
||||
@@ -1752,6 +1770,12 @@ public class FirOldFrontendMPPDiagnosticsWithLightTreeTestGenerated extends Abst
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/hmpp/hmppRedeclarationWithExpectActualPair.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("hmppSignatureClash.kt")
|
||||
public void testHmppSignatureClash() {
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/hmpp/hmppSignatureClash.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("intermediateActualHasAdditionalSupertypes.kt")
|
||||
public void testIntermediateActualHasAdditionalSupertypes() {
|
||||
|
||||
+24
@@ -1729,6 +1729,18 @@ public class FirOldFrontendMPPDiagnosticsWithPsiTestGenerated extends AbstractFi
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/multiplatform/hmpp")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class Hmpp {
|
||||
@Test
|
||||
@TestMetadata("actualizeSubtypeBeforeSupertype.kt")
|
||||
public void testActualizeSubtypeBeforeSupertype() {
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/hmpp/actualizeSubtypeBeforeSupertype.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("actualizedInPlatformSession.kt")
|
||||
public void testActualizedInPlatformSession() {
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/hmpp/actualizedInPlatformSession.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAllFilesPresentInHmpp() {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/multiplatform/hmpp"), Pattern.compile("^(.*)\\.kts?$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), TargetBackend.JVM_IR, true);
|
||||
@@ -1740,6 +1752,12 @@ public class FirOldFrontendMPPDiagnosticsWithPsiTestGenerated extends AbstractFi
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/hmpp/ambiguousActuals.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("hmppModalityClash.kt")
|
||||
public void testHmppModalityClash() {
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/hmpp/hmppModalityClash.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("hmppRedeclaration.kt")
|
||||
public void testHmppRedeclaration() {
|
||||
@@ -1752,6 +1770,12 @@ public class FirOldFrontendMPPDiagnosticsWithPsiTestGenerated extends AbstractFi
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/hmpp/hmppRedeclarationWithExpectActualPair.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("hmppSignatureClash.kt")
|
||||
public void testHmppSignatureClash() {
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/hmpp/hmppSignatureClash.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("intermediateActualHasAdditionalSupertypes.kt")
|
||||
public void testIntermediateActualHasAdditionalSupertypes() {
|
||||
|
||||
+2
-1
@@ -12,6 +12,7 @@ import org.jetbrains.kotlin.descriptors.ClassKind
|
||||
import org.jetbrains.kotlin.diagnostics.DiagnosticReporter
|
||||
import org.jetbrains.kotlin.diagnostics.SourceElementPositioningStrategies
|
||||
import org.jetbrains.kotlin.diagnostics.reportOn
|
||||
import org.jetbrains.kotlin.diagnostics.requireNotNull
|
||||
import org.jetbrains.kotlin.fir.*
|
||||
import org.jetbrains.kotlin.fir.analysis.checkers.MppCheckerKind
|
||||
import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext
|
||||
@@ -33,7 +34,7 @@ import org.jetbrains.kotlin.resolve.multiplatform.ExpectActualCompatibility
|
||||
import org.jetbrains.kotlin.resolve.multiplatform.ExpectActualMatchingCompatibility
|
||||
|
||||
@Suppress("DuplicatedCode")
|
||||
object FirExpectActualDeclarationChecker : FirBasicDeclarationChecker(MppCheckerKind.Common) {
|
||||
object FirExpectActualDeclarationChecker : FirBasicDeclarationChecker(MppCheckerKind.Platform) {
|
||||
override fun check(declaration: FirDeclaration, context: CheckerContext, reporter: DiagnosticReporter) {
|
||||
if (declaration !is FirMemberDeclaration) return
|
||||
if (!context.session.languageVersionSettings.supportsFeature(LanguageFeature.MultiPlatformProjects)) {
|
||||
|
||||
Reference in New Issue
Block a user