[FIR] Switch FirExpectActualDeclarationChecker to Platform checker
^KT-66028 Fixed
This commit is contained in:
+24
@@ -26676,6 +26676,18 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
|
|||||||
@TestMetadata("compiler/testData/diagnostics/tests/multiplatform/hmpp")
|
@TestMetadata("compiler/testData/diagnostics/tests/multiplatform/hmpp")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
public class Hmpp {
|
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
|
@Test
|
||||||
public void testAllFilesPresentInHmpp() {
|
public void testAllFilesPresentInHmpp() {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/multiplatform/hmpp"), Pattern.compile("^(.+)\\.(kt|kts)$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/multiplatform/hmpp"), Pattern.compile("^(.+)\\.(kt|kts)$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true);
|
||||||
@@ -26687,6 +26699,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
|
|||||||
runTest("compiler/testData/diagnostics/tests/multiplatform/hmpp/ambiguousActuals.kt");
|
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
|
@Test
|
||||||
@TestMetadata("hmppRedeclaration.kt")
|
@TestMetadata("hmppRedeclaration.kt")
|
||||||
public void testHmppRedeclaration() {
|
public void testHmppRedeclaration() {
|
||||||
@@ -26699,6 +26717,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
|
|||||||
runTest("compiler/testData/diagnostics/tests/multiplatform/hmpp/hmppRedeclarationWithExpectActualPair.kt");
|
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
|
@Test
|
||||||
@TestMetadata("intermediateActualHasAdditionalSupertypes.kt")
|
@TestMetadata("intermediateActualHasAdditionalSupertypes.kt")
|
||||||
public void testIntermediateActualHasAdditionalSupertypes() {
|
public void testIntermediateActualHasAdditionalSupertypes() {
|
||||||
|
|||||||
+24
@@ -26676,6 +26676,18 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
|
|||||||
@TestMetadata("compiler/testData/diagnostics/tests/multiplatform/hmpp")
|
@TestMetadata("compiler/testData/diagnostics/tests/multiplatform/hmpp")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
public class Hmpp {
|
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
|
@Test
|
||||||
public void testAllFilesPresentInHmpp() {
|
public void testAllFilesPresentInHmpp() {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/multiplatform/hmpp"), Pattern.compile("^(.+)\\.(kt|kts)$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/multiplatform/hmpp"), Pattern.compile("^(.+)\\.(kt|kts)$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true);
|
||||||
@@ -26687,6 +26699,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
|
|||||||
runTest("compiler/testData/diagnostics/tests/multiplatform/hmpp/ambiguousActuals.kt");
|
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
|
@Test
|
||||||
@TestMetadata("hmppRedeclaration.kt")
|
@TestMetadata("hmppRedeclaration.kt")
|
||||||
public void testHmppRedeclaration() {
|
public void testHmppRedeclaration() {
|
||||||
@@ -26699,6 +26717,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
|
|||||||
runTest("compiler/testData/diagnostics/tests/multiplatform/hmpp/hmppRedeclarationWithExpectActualPair.kt");
|
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
|
@Test
|
||||||
@TestMetadata("intermediateActualHasAdditionalSupertypes.kt")
|
@TestMetadata("intermediateActualHasAdditionalSupertypes.kt")
|
||||||
public void testIntermediateActualHasAdditionalSupertypes() {
|
public void testIntermediateActualHasAdditionalSupertypes() {
|
||||||
|
|||||||
+24
@@ -1729,6 +1729,18 @@ public class FirOldFrontendMPPDiagnosticsWithLightTreeTestGenerated extends Abst
|
|||||||
@TestMetadata("compiler/testData/diagnostics/tests/multiplatform/hmpp")
|
@TestMetadata("compiler/testData/diagnostics/tests/multiplatform/hmpp")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
public class Hmpp {
|
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
|
@Test
|
||||||
public void testAllFilesPresentInHmpp() {
|
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);
|
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");
|
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
|
@Test
|
||||||
@TestMetadata("hmppRedeclaration.kt")
|
@TestMetadata("hmppRedeclaration.kt")
|
||||||
public void testHmppRedeclaration() {
|
public void testHmppRedeclaration() {
|
||||||
@@ -1752,6 +1770,12 @@ public class FirOldFrontendMPPDiagnosticsWithLightTreeTestGenerated extends Abst
|
|||||||
runTest("compiler/testData/diagnostics/tests/multiplatform/hmpp/hmppRedeclarationWithExpectActualPair.kt");
|
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
|
@Test
|
||||||
@TestMetadata("intermediateActualHasAdditionalSupertypes.kt")
|
@TestMetadata("intermediateActualHasAdditionalSupertypes.kt")
|
||||||
public void testIntermediateActualHasAdditionalSupertypes() {
|
public void testIntermediateActualHasAdditionalSupertypes() {
|
||||||
|
|||||||
+24
@@ -1729,6 +1729,18 @@ public class FirOldFrontendMPPDiagnosticsWithPsiTestGenerated extends AbstractFi
|
|||||||
@TestMetadata("compiler/testData/diagnostics/tests/multiplatform/hmpp")
|
@TestMetadata("compiler/testData/diagnostics/tests/multiplatform/hmpp")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
public class Hmpp {
|
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
|
@Test
|
||||||
public void testAllFilesPresentInHmpp() {
|
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);
|
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");
|
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
|
@Test
|
||||||
@TestMetadata("hmppRedeclaration.kt")
|
@TestMetadata("hmppRedeclaration.kt")
|
||||||
public void testHmppRedeclaration() {
|
public void testHmppRedeclaration() {
|
||||||
@@ -1752,6 +1770,12 @@ public class FirOldFrontendMPPDiagnosticsWithPsiTestGenerated extends AbstractFi
|
|||||||
runTest("compiler/testData/diagnostics/tests/multiplatform/hmpp/hmppRedeclarationWithExpectActualPair.kt");
|
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
|
@Test
|
||||||
@TestMetadata("intermediateActualHasAdditionalSupertypes.kt")
|
@TestMetadata("intermediateActualHasAdditionalSupertypes.kt")
|
||||||
public void testIntermediateActualHasAdditionalSupertypes() {
|
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.DiagnosticReporter
|
||||||
import org.jetbrains.kotlin.diagnostics.SourceElementPositioningStrategies
|
import org.jetbrains.kotlin.diagnostics.SourceElementPositioningStrategies
|
||||||
import org.jetbrains.kotlin.diagnostics.reportOn
|
import org.jetbrains.kotlin.diagnostics.reportOn
|
||||||
|
import org.jetbrains.kotlin.diagnostics.requireNotNull
|
||||||
import org.jetbrains.kotlin.fir.*
|
import org.jetbrains.kotlin.fir.*
|
||||||
import org.jetbrains.kotlin.fir.analysis.checkers.MppCheckerKind
|
import org.jetbrains.kotlin.fir.analysis.checkers.MppCheckerKind
|
||||||
import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext
|
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
|
import org.jetbrains.kotlin.resolve.multiplatform.ExpectActualMatchingCompatibility
|
||||||
|
|
||||||
@Suppress("DuplicatedCode")
|
@Suppress("DuplicatedCode")
|
||||||
object FirExpectActualDeclarationChecker : FirBasicDeclarationChecker(MppCheckerKind.Common) {
|
object FirExpectActualDeclarationChecker : FirBasicDeclarationChecker(MppCheckerKind.Platform) {
|
||||||
override fun check(declaration: FirDeclaration, context: CheckerContext, reporter: DiagnosticReporter) {
|
override fun check(declaration: FirDeclaration, context: CheckerContext, reporter: DiagnosticReporter) {
|
||||||
if (declaration !is FirMemberDeclaration) return
|
if (declaration !is FirMemberDeclaration) return
|
||||||
if (!context.session.languageVersionSettings.supportsFeature(LanguageFeature.MultiPlatformProjects)) {
|
if (!context.session.languageVersionSettings.supportsFeature(LanguageFeature.MultiPlatformProjects)) {
|
||||||
|
|||||||
Vendored
+21
@@ -0,0 +1,21 @@
|
|||||||
|
// MODULE: common
|
||||||
|
// TARGET_PLATFORM: Common
|
||||||
|
<!EXPECT_ACTUAL_INCOMPATIBILITY{JVM}!>expect class A() : B<!>
|
||||||
|
<!EXPECT_ACTUAL_INCOMPATIBILITY{JVM}!>expect class C() : B<!>
|
||||||
|
expect open class B()
|
||||||
|
|
||||||
|
// MODULE: intermediate()()(common)
|
||||||
|
// TARGET_PLATFORM: Common
|
||||||
|
actual class A : B() {
|
||||||
|
// "Nothing to override" in metadata compilation. Unfortunately we don't check metadata compilation in diagnostic tests
|
||||||
|
override fun foo() {}
|
||||||
|
}
|
||||||
|
actual class C : B() {
|
||||||
|
// Nothing to override in platform compilation.
|
||||||
|
fun <!VIRTUAL_MEMBER_HIDDEN!>foo<!>() {}
|
||||||
|
}
|
||||||
|
|
||||||
|
// MODULE: main()()(intermediate)
|
||||||
|
actual open class B {
|
||||||
|
open fun foo() {}
|
||||||
|
}
|
||||||
+21
@@ -0,0 +1,21 @@
|
|||||||
|
// MODULE: common
|
||||||
|
// TARGET_PLATFORM: Common
|
||||||
|
expect <!EXPECT_AND_ACTUAL_IN_THE_SAME_MODULE{COMMON}!>class A<!>() : B
|
||||||
|
expect <!EXPECT_AND_ACTUAL_IN_THE_SAME_MODULE{COMMON}!>class C<!>() : B
|
||||||
|
expect open class B()
|
||||||
|
|
||||||
|
// MODULE: intermediate()()(common)
|
||||||
|
// TARGET_PLATFORM: Common
|
||||||
|
actual <!EXPECT_AND_ACTUAL_IN_THE_SAME_MODULE!>class A<!> : B() {
|
||||||
|
// "Nothing to override" in metadata compilation. Unfortunately we don't check metadata compilation in diagnostic tests
|
||||||
|
<!NOTHING_TO_OVERRIDE!>override<!> fun foo() {}
|
||||||
|
}
|
||||||
|
actual <!EXPECT_AND_ACTUAL_IN_THE_SAME_MODULE!>class C<!> : B() {
|
||||||
|
// Nothing to override in platform compilation.
|
||||||
|
fun <!VIRTUAL_MEMBER_HIDDEN{JVM}!>foo<!>() {}
|
||||||
|
}
|
||||||
|
|
||||||
|
// MODULE: main()()(intermediate)
|
||||||
|
actual open class B {
|
||||||
|
open fun foo() {}
|
||||||
|
}
|
||||||
Vendored
+21
@@ -0,0 +1,21 @@
|
|||||||
|
// MODULE: common
|
||||||
|
// TARGET_PLATFORM: Common
|
||||||
|
expect class A() : B
|
||||||
|
expect class C() : B
|
||||||
|
expect open class B()
|
||||||
|
|
||||||
|
// MODULE: intermediate()()(common)
|
||||||
|
// TARGET_PLATFORM: Common
|
||||||
|
actual class A : B() {
|
||||||
|
// "Nothing to override" in metadata compilation. Unfortunately we don't check metadata compilation in diagnostic tests
|
||||||
|
<!NOTHING_TO_OVERRIDE!>override<!> fun foo() {}
|
||||||
|
}
|
||||||
|
actual class C : B() {
|
||||||
|
// Nothing to override in platform compilation.
|
||||||
|
fun foo() {}
|
||||||
|
}
|
||||||
|
|
||||||
|
// MODULE: main()()(intermediate)
|
||||||
|
actual open class B {
|
||||||
|
open fun foo() {}
|
||||||
|
}
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
// MODULE: common
|
||||||
|
// TARGET_PLATFORM: Common
|
||||||
|
<!EXPECT_ACTUAL_INCOMPATIBILITY{JVM}!>expect class Foo() {
|
||||||
|
<!NO_ACTUAL_FOR_EXPECT{JVM}!>fun foo()<!>
|
||||||
|
}<!>
|
||||||
|
|
||||||
|
// MODULE: intermediate()()(common)
|
||||||
|
// TARGET_PLATFORM: Common
|
||||||
|
expect open class Base() {}
|
||||||
|
|
||||||
|
actual class Foo : Base() {
|
||||||
|
}
|
||||||
|
|
||||||
|
// MODULE: main()()(intermediate)
|
||||||
|
actual open class Base {
|
||||||
|
fun foo() {}
|
||||||
|
}
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
// MODULE: common
|
||||||
|
// TARGET_PLATFORM: Common
|
||||||
|
expect <!EXPECT_AND_ACTUAL_IN_THE_SAME_MODULE{COMMON}!>class Foo<!>() {
|
||||||
|
fun foo()
|
||||||
|
}
|
||||||
|
|
||||||
|
// MODULE: intermediate()()(common)
|
||||||
|
// TARGET_PLATFORM: Common
|
||||||
|
expect open class Base() {}
|
||||||
|
|
||||||
|
actual <!EXPECT_AND_ACTUAL_IN_THE_SAME_MODULE!>class Foo<!> : Base() {
|
||||||
|
}
|
||||||
|
|
||||||
|
// MODULE: main()()(intermediate)
|
||||||
|
actual open class Base {
|
||||||
|
fun foo() {}
|
||||||
|
}
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
// MODULE: common
|
||||||
|
// TARGET_PLATFORM: Common
|
||||||
|
expect class Foo() {
|
||||||
|
fun foo()
|
||||||
|
}
|
||||||
|
|
||||||
|
// MODULE: intermediate()()(common)
|
||||||
|
// TARGET_PLATFORM: Common
|
||||||
|
expect open class Base() {}
|
||||||
|
|
||||||
|
actual class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Foo<!> : Base() {
|
||||||
|
}
|
||||||
|
|
||||||
|
// MODULE: main()()(intermediate)
|
||||||
|
actual open class Base {
|
||||||
|
fun foo() {}
|
||||||
|
}
|
||||||
+30
@@ -0,0 +1,30 @@
|
|||||||
|
// MODULE: common
|
||||||
|
// TARGET_PLATFORM: Common
|
||||||
|
expect abstract class Foo() {
|
||||||
|
abstract fun foo()
|
||||||
|
}
|
||||||
|
|
||||||
|
class Impl : Foo() {}
|
||||||
|
|
||||||
|
fun common() {
|
||||||
|
Impl().foo()
|
||||||
|
}
|
||||||
|
|
||||||
|
// MODULE: intermediate()()(common)
|
||||||
|
// TARGET_PLATFORM: Common
|
||||||
|
interface I {
|
||||||
|
fun foo()
|
||||||
|
}
|
||||||
|
|
||||||
|
expect open class Base() {}
|
||||||
|
|
||||||
|
actual abstract class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Foo<!> : Base(), I {
|
||||||
|
// In non-KMP world, these two f/o would squash into a single f/o final fun foo()
|
||||||
|
// f/o abstract fun foo(): Unit in intermediate
|
||||||
|
// f/o final fun foo(): Unit in platform
|
||||||
|
}
|
||||||
|
|
||||||
|
// MODULE: main()()(intermediate)
|
||||||
|
actual open class Base {
|
||||||
|
fun foo() {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
// MODULE: common
|
||||||
|
// TARGET_PLATFORM: Common
|
||||||
|
expect abstract <!EXPECT_AND_ACTUAL_IN_THE_SAME_MODULE{COMMON}!>class Foo<!>() {
|
||||||
|
abstract fun foo()
|
||||||
|
}
|
||||||
|
|
||||||
|
<!ABSTRACT_CLASS_MEMBER_NOT_IMPLEMENTED, ABSTRACT_CLASS_MEMBER_NOT_IMPLEMENTED{COMMON}!>class Impl<!> : Foo() {}
|
||||||
|
|
||||||
|
fun common() {
|
||||||
|
Impl().foo()
|
||||||
|
}
|
||||||
|
|
||||||
|
// MODULE: intermediate()()(common)
|
||||||
|
// TARGET_PLATFORM: Common
|
||||||
|
interface I {
|
||||||
|
fun foo()
|
||||||
|
}
|
||||||
|
|
||||||
|
expect open class Base() {}
|
||||||
|
|
||||||
|
actual abstract <!EXPECT_AND_ACTUAL_IN_THE_SAME_MODULE!>class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS{JVM}!>Foo<!><!> : Base(), I {
|
||||||
|
// In non-KMP world, these two f/o would squash into a single f/o final fun foo()
|
||||||
|
// f/o abstract fun foo(): Unit in intermediate
|
||||||
|
// f/o final fun foo(): Unit in platform
|
||||||
|
}
|
||||||
|
|
||||||
|
// MODULE: main()()(intermediate)
|
||||||
|
actual open class Base {
|
||||||
|
fun foo() {}
|
||||||
|
}
|
||||||
+30
@@ -0,0 +1,30 @@
|
|||||||
|
// MODULE: common
|
||||||
|
// TARGET_PLATFORM: Common
|
||||||
|
expect abstract class Foo() {
|
||||||
|
abstract fun foo()
|
||||||
|
}
|
||||||
|
|
||||||
|
<!ABSTRACT_CLASS_MEMBER_NOT_IMPLEMENTED!>class Impl<!> : Foo() {}
|
||||||
|
|
||||||
|
fun common() {
|
||||||
|
Impl().foo()
|
||||||
|
}
|
||||||
|
|
||||||
|
// MODULE: intermediate()()(common)
|
||||||
|
// TARGET_PLATFORM: Common
|
||||||
|
interface I {
|
||||||
|
fun foo()
|
||||||
|
}
|
||||||
|
|
||||||
|
expect open class Base() {}
|
||||||
|
|
||||||
|
actual abstract class Foo : Base(), I {
|
||||||
|
// In non-KMP world, these two f/o would squash into a single f/o final fun foo()
|
||||||
|
// f/o abstract fun foo(): Unit in intermediate
|
||||||
|
// f/o final fun foo(): Unit in platform
|
||||||
|
}
|
||||||
|
|
||||||
|
// MODULE: main()()(intermediate)
|
||||||
|
actual open class Base {
|
||||||
|
fun foo() {}
|
||||||
|
}
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
// MODULE: common
|
||||||
|
// TARGET_PLATFORM: Common
|
||||||
|
expect class A {
|
||||||
|
fun foo(x: String): String
|
||||||
|
}
|
||||||
|
|
||||||
|
// MODULE: intermediate()()(common)
|
||||||
|
// TARGET_PLATFORM: Common
|
||||||
|
expect class B
|
||||||
|
|
||||||
|
// K1 EXPECT_AND_ACTUAL_IN_THE_SAME_MODULE false positive
|
||||||
|
actual class A {
|
||||||
|
actual fun <!ACTUAL_WITHOUT_EXPECT!>foo<!>(x: B) = "a"
|
||||||
|
}
|
||||||
|
|
||||||
|
// MODULE: main()()(intermediate)
|
||||||
|
actual typealias B = String
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
// MODULE: common
|
||||||
|
// TARGET_PLATFORM: Common
|
||||||
|
expect <!EXPECT_AND_ACTUAL_IN_THE_SAME_MODULE{COMMON}!>class A<!> {
|
||||||
|
fun foo(x: String): String
|
||||||
|
}
|
||||||
|
|
||||||
|
// MODULE: intermediate()()(common)
|
||||||
|
// TARGET_PLATFORM: Common
|
||||||
|
expect class B
|
||||||
|
|
||||||
|
// K1 EXPECT_AND_ACTUAL_IN_THE_SAME_MODULE false positive
|
||||||
|
actual <!EXPECT_AND_ACTUAL_IN_THE_SAME_MODULE!>class A<!> {
|
||||||
|
actual fun foo(x: B) = "a"
|
||||||
|
}
|
||||||
|
|
||||||
|
// MODULE: main()()(intermediate)
|
||||||
|
actual typealias B = String
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
// MODULE: common
|
||||||
|
// TARGET_PLATFORM: Common
|
||||||
|
expect class A {
|
||||||
|
fun foo(x: String): String
|
||||||
|
}
|
||||||
|
|
||||||
|
// MODULE: intermediate()()(common)
|
||||||
|
// TARGET_PLATFORM: Common
|
||||||
|
expect class B
|
||||||
|
|
||||||
|
// K1 EXPECT_AND_ACTUAL_IN_THE_SAME_MODULE false positive
|
||||||
|
actual class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>A<!> {
|
||||||
|
actual fun <!ACTUAL_WITHOUT_EXPECT!>foo<!>(x: B) = "a"
|
||||||
|
}
|
||||||
|
|
||||||
|
// MODULE: main()()(intermediate)
|
||||||
|
actual typealias B = String
|
||||||
Generated
+24
@@ -26676,6 +26676,18 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
|||||||
@TestMetadata("compiler/testData/diagnostics/tests/multiplatform/hmpp")
|
@TestMetadata("compiler/testData/diagnostics/tests/multiplatform/hmpp")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
public class Hmpp {
|
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
|
@Test
|
||||||
public void testAllFilesPresentInHmpp() {
|
public void testAllFilesPresentInHmpp() {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/multiplatform/hmpp"), Pattern.compile("^(.*)\\.kts?$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/multiplatform/hmpp"), Pattern.compile("^(.*)\\.kts?$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true);
|
||||||
@@ -26687,6 +26699,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
|||||||
runTest("compiler/testData/diagnostics/tests/multiplatform/hmpp/ambiguousActuals.kt");
|
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
|
@Test
|
||||||
@TestMetadata("hmppRedeclaration.kt")
|
@TestMetadata("hmppRedeclaration.kt")
|
||||||
public void testHmppRedeclaration() {
|
public void testHmppRedeclaration() {
|
||||||
@@ -26699,6 +26717,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
|||||||
runTest("compiler/testData/diagnostics/tests/multiplatform/hmpp/hmppRedeclarationWithExpectActualPair.kt");
|
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
|
@Test
|
||||||
@TestMetadata("intermediateActualHasAdditionalSupertypes.kt")
|
@TestMetadata("intermediateActualHasAdditionalSupertypes.kt")
|
||||||
public void testIntermediateActualHasAdditionalSupertypes() {
|
public void testIntermediateActualHasAdditionalSupertypes() {
|
||||||
|
|||||||
Reference in New Issue
Block a user