From ae4fab8483a10846a8179731c18168a846298d6c Mon Sep 17 00:00:00 2001 From: "marat.akhin" Date: Thu, 20 Jul 2023 18:16:06 +0200 Subject: [PATCH] [KMP] Allow matching expect ctorless final classes to objects both directly and via typealias. This is a possible fix to KT-59747 --- ...DiagnosticsWithLightTreeTestGenerated.java | 22 ++++++++ ...endMPPDiagnosticsWithPsiTestGenerated.java | 22 ++++++++ ...LightTreeBlackBoxCodegenTestGenerated.java | 44 +++++++++++++++ .../FirPsiBlackBoxCodegenTestGenerated.java | 44 +++++++++++++++ ...bstractExpectActualCompatibilityChecker.kt | 24 ++++++++- .../expectCtorlessFinalToActualObject.kt | 42 +++++++++++++++ ...xpectCtorlessFinalToActualPromiseOfUnit.kt | 48 +++++++++++++++++ .../expectCtorlessFinalToActualUnit.kt | 40 ++++++++++++++ .../expectCtorlessFinalToActualObject.kt | 42 +++++++++++++++ ...xpectCtorlessFinalToActualPromiseOfUnit.kt | 48 +++++++++++++++++ .../expectCtorlessFinalToActualUnit.kt | 40 ++++++++++++++ .../expectCtorlessFinalToActualObject.fir.kt | 47 ++++++++++++++++ .../expectCtorlessFinalToActualObject.kt | 47 ++++++++++++++++ ...lessFinalToActualObjectViaTypealias.fir.kt | 49 +++++++++++++++++ ...CtorlessFinalToActualObjectViaTypealias.kt | 49 +++++++++++++++++ .../test/runners/DiagnosticTestGenerated.java | 22 ++++++++ .../codegen/BlackBoxCodegenTestGenerated.java | 44 +++++++++++++++ .../IrBlackBoxCodegenTestGenerated.java | 44 +++++++++++++++ ...kBoxCodegenWithIrInlinerTestGenerated.java | 44 +++++++++++++++ .../LightAnalysisModeTestGenerated.java | 46 ++++++++++++++++ .../fir/FirJsCodegenBoxTestGenerated.java | 44 +++++++++++++++ .../fir/FirJsES6CodegenBoxTestGenerated.java | 44 +++++++++++++++ .../test/ir/IrJsCodegenBoxTestGenerated.java | 44 +++++++++++++++ .../ir/IrJsES6CodegenBoxTestGenerated.java | 44 +++++++++++++++ .../FirNativeCodegenBoxTestGenerated.java | 50 +++++++++++++++++ .../FirNativeCodegenBoxTestNoPLGenerated.java | 54 +++++++++++++++++++ .../NativeCodegenBoxTestGenerated.java | 48 +++++++++++++++++ .../NativeCodegenBoxTestNoPLGenerated.java | 50 +++++++++++++++++ .../test/FirWasmCodegenBoxTestGenerated.java | 44 +++++++++++++++ .../test/K1WasmCodegenBoxTestGenerated.java | 44 +++++++++++++++ 30 files changed, 1273 insertions(+), 1 deletion(-) create mode 100644 compiler/testData/codegen/box/multiplatform/complexMatchings/expectCtorlessFinalToActualObject.kt create mode 100644 compiler/testData/codegen/box/multiplatform/complexMatchings/expectCtorlessFinalToActualPromiseOfUnit.kt create mode 100644 compiler/testData/codegen/box/multiplatform/complexMatchings/expectCtorlessFinalToActualUnit.kt create mode 100644 compiler/testData/codegen/box/multiplatform/k2/complexMatchings/expectCtorlessFinalToActualObject.kt create mode 100644 compiler/testData/codegen/box/multiplatform/k2/complexMatchings/expectCtorlessFinalToActualPromiseOfUnit.kt create mode 100644 compiler/testData/codegen/box/multiplatform/k2/complexMatchings/expectCtorlessFinalToActualUnit.kt create mode 100644 compiler/testData/diagnostics/tests/multiplatform/complexMatchings/expectCtorlessFinalToActualObject.fir.kt create mode 100644 compiler/testData/diagnostics/tests/multiplatform/complexMatchings/expectCtorlessFinalToActualObject.kt create mode 100644 compiler/testData/diagnostics/tests/multiplatform/complexMatchings/expectCtorlessFinalToActualObjectViaTypealias.fir.kt create mode 100644 compiler/testData/diagnostics/tests/multiplatform/complexMatchings/expectCtorlessFinalToActualObjectViaTypealias.kt diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendMPPDiagnosticsWithLightTreeTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendMPPDiagnosticsWithLightTreeTestGenerated.java index d92a54d958c..f9615865552 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendMPPDiagnosticsWithLightTreeTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendMPPDiagnosticsWithLightTreeTestGenerated.java @@ -347,6 +347,28 @@ public class FirOldFrontendMPPDiagnosticsWithLightTreeTestGenerated extends Abst } } + @Nested + @TestMetadata("compiler/testData/diagnostics/tests/multiplatform/complexMatchings") + @TestDataPath("$PROJECT_ROOT") + public class ComplexMatchings { + @Test + public void testAllFilesPresentInComplexMatchings() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/multiplatform/complexMatchings"), Pattern.compile("^(.*)\\.kts?$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualObject.kt") + public void testExpectCtorlessFinalToActualObject() throws Exception { + runTest("compiler/testData/diagnostics/tests/multiplatform/complexMatchings/expectCtorlessFinalToActualObject.kt"); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualObjectViaTypealias.kt") + public void testExpectCtorlessFinalToActualObjectViaTypealias() throws Exception { + runTest("compiler/testData/diagnostics/tests/multiplatform/complexMatchings/expectCtorlessFinalToActualObjectViaTypealias.kt"); + } + } + @Nested @TestMetadata("compiler/testData/diagnostics/tests/multiplatform/defaultArguments") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendMPPDiagnosticsWithPsiTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendMPPDiagnosticsWithPsiTestGenerated.java index 95bced7561c..6d3ea240385 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendMPPDiagnosticsWithPsiTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendMPPDiagnosticsWithPsiTestGenerated.java @@ -347,6 +347,28 @@ public class FirOldFrontendMPPDiagnosticsWithPsiTestGenerated extends AbstractFi } } + @Nested + @TestMetadata("compiler/testData/diagnostics/tests/multiplatform/complexMatchings") + @TestDataPath("$PROJECT_ROOT") + public class ComplexMatchings { + @Test + public void testAllFilesPresentInComplexMatchings() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/multiplatform/complexMatchings"), Pattern.compile("^(.*)\\.kts?$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualObject.kt") + public void testExpectCtorlessFinalToActualObject() throws Exception { + runTest("compiler/testData/diagnostics/tests/multiplatform/complexMatchings/expectCtorlessFinalToActualObject.kt"); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualObjectViaTypealias.kt") + public void testExpectCtorlessFinalToActualObjectViaTypealias() throws Exception { + runTest("compiler/testData/diagnostics/tests/multiplatform/complexMatchings/expectCtorlessFinalToActualObjectViaTypealias.kt"); + } + } + @Nested @TestMetadata("compiler/testData/diagnostics/tests/multiplatform/defaultArguments") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java index b227b65537a..ae097ff8f4c 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java @@ -33417,6 +33417,28 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr runTest("compiler/testData/codegen/box/multiplatform/starImportOfExpectEnumWithActualTypeAlias.kt"); } + @Nested + @TestMetadata("compiler/testData/codegen/box/multiplatform/complexMatchings") + @TestDataPath("$PROJECT_ROOT") + public class ComplexMatchings { + @Test + public void testAllFilesPresentInComplexMatchings() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/complexMatchings"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualObject.kt") + public void testExpectCtorlessFinalToActualObject() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/complexMatchings/expectCtorlessFinalToActualObject.kt"); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualUnit.kt") + public void testExpectCtorlessFinalToActualUnit() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/complexMatchings/expectCtorlessFinalToActualUnit.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/multiplatform/defaultArguments") @TestDataPath("$PROJECT_ROOT") @@ -33950,6 +33972,28 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr } } + @Nested + @TestMetadata("compiler/testData/codegen/box/multiplatform/k2/complexMatchings") + @TestDataPath("$PROJECT_ROOT") + public class ComplexMatchings { + @Test + public void testAllFilesPresentInComplexMatchings() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/k2/complexMatchings"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualObject.kt") + public void testExpectCtorlessFinalToActualObject() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/complexMatchings/expectCtorlessFinalToActualObject.kt"); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualUnit.kt") + public void testExpectCtorlessFinalToActualUnit() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/complexMatchings/expectCtorlessFinalToActualUnit.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/multiplatform/k2/defaultArguments") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java index 191b26fc94a..3971a2b4b48 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java @@ -33417,6 +33417,28 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo runTest("compiler/testData/codegen/box/multiplatform/starImportOfExpectEnumWithActualTypeAlias.kt"); } + @Nested + @TestMetadata("compiler/testData/codegen/box/multiplatform/complexMatchings") + @TestDataPath("$PROJECT_ROOT") + public class ComplexMatchings { + @Test + public void testAllFilesPresentInComplexMatchings() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/complexMatchings"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualObject.kt") + public void testExpectCtorlessFinalToActualObject() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/complexMatchings/expectCtorlessFinalToActualObject.kt"); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualUnit.kt") + public void testExpectCtorlessFinalToActualUnit() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/complexMatchings/expectCtorlessFinalToActualUnit.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/multiplatform/defaultArguments") @TestDataPath("$PROJECT_ROOT") @@ -33950,6 +33972,28 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo } } + @Nested + @TestMetadata("compiler/testData/codegen/box/multiplatform/k2/complexMatchings") + @TestDataPath("$PROJECT_ROOT") + public class ComplexMatchings { + @Test + public void testAllFilesPresentInComplexMatchings() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/k2/complexMatchings"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualObject.kt") + public void testExpectCtorlessFinalToActualObject() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/complexMatchings/expectCtorlessFinalToActualObject.kt"); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualUnit.kt") + public void testExpectCtorlessFinalToActualUnit() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/complexMatchings/expectCtorlessFinalToActualUnit.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/multiplatform/k2/defaultArguments") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/resolution.common/src/org/jetbrains/kotlin/resolve/calls/mpp/AbstractExpectActualCompatibilityChecker.kt b/compiler/resolution.common/src/org/jetbrains/kotlin/resolve/calls/mpp/AbstractExpectActualCompatibilityChecker.kt index 70b0667919d..1a00e87e4a1 100644 --- a/compiler/resolution.common/src/org/jetbrains/kotlin/resolve/calls/mpp/AbstractExpectActualCompatibilityChecker.kt +++ b/compiler/resolution.common/src/org/jetbrains/kotlin/resolve/calls/mpp/AbstractExpectActualCompatibilityChecker.kt @@ -86,7 +86,7 @@ object AbstractExpectActualCompatibilityChecker { else -> error("Incorrect actual classifier for $expectClassSymbol: $actualClassLikeSymbol") } - if (expectClassSymbol.classKind != actualClass.classKind) return Incompatible.ClassKind + if (!areCompatibleClassKinds(expectClassSymbol, actualClass)) return Incompatible.ClassKind if (!equalBy(expectClassSymbol, actualClass) { listOf(it.isCompanion, it.isInner, it.isInline || it.isValue) }) { return Incompatible.ClassModifiers @@ -440,6 +440,20 @@ object AbstractExpectActualCompatibilityChecker { return true } + context(ExpectActualMatchingContext<*>) + private fun areCompatibleClassKinds( + expectClass: RegularClassSymbolMarker, + actualClass: RegularClassSymbolMarker, + ): Boolean { + if (expectClass.classKind == actualClass.classKind) return true + + if (expectClass.classKind == ClassKind.CLASS && expectClass.isFinal && expectClass.isCtorless) { + if (actualClass.classKind == ClassKind.OBJECT) return true + } + + return false + } + private fun areCompatibleModalities( expectModality: Modality?, actualModality: Modality?, @@ -606,4 +620,12 @@ object AbstractExpectActualCompatibilityChecker { is TypeParameterSymbolMarker -> parameterName else -> error("Unsupported declaration: $this") } + + context(ExpectActualMatchingContext<*>) + private val RegularClassSymbolMarker.isCtorless: Boolean + get() = getMembersForExpectClass(SpecialNames.INIT).isEmpty() + + context(ExpectActualMatchingContext<*>) + private val RegularClassSymbolMarker.isFinal: Boolean + get() = modality == Modality.FINAL } diff --git a/compiler/testData/codegen/box/multiplatform/complexMatchings/expectCtorlessFinalToActualObject.kt b/compiler/testData/codegen/box/multiplatform/complexMatchings/expectCtorlessFinalToActualObject.kt new file mode 100644 index 00000000000..d1726b224d0 --- /dev/null +++ b/compiler/testData/codegen/box/multiplatform/complexMatchings/expectCtorlessFinalToActualObject.kt @@ -0,0 +1,42 @@ +// LANGUAGE: +MultiPlatformProjects +// IGNORE_BACKEND_K2: ANY +// FIR status: expect/actual in the same module +// also used as a workaround for no multi-module support in K1 box tests + +// FILE: common.kt + +expect class TestResult + +expect fun createTestResult(): TestResult + +fun commonBox(): String { + val tr = createTestResult() + val tr2 = if (true) tr else createTestResult() + + if (tr != tr2) return "c01" + if (tr.hashCode() != tr2.hashCode()) return "c02" + if (tr.toString() != tr2.toString()) return "c03" + + return "O" +} + +// FILE: actual.kt + +actual object TestResult { + fun doTest(): TestResult = this +} + +actual fun createTestResult(): TestResult = TestResult + +fun platformBox(): String { + val tr = createTestResult() + val tr2 = if (true) tr else createTestResult() + + if (tr != tr2) return "p01" + if (tr.hashCode() != tr2.hashCode()) return "p02" + if (tr.toString() != tr2.toString()) return "p03" + + return "K" +} + +fun box() = commonBox() + platformBox() diff --git a/compiler/testData/codegen/box/multiplatform/complexMatchings/expectCtorlessFinalToActualPromiseOfUnit.kt b/compiler/testData/codegen/box/multiplatform/complexMatchings/expectCtorlessFinalToActualPromiseOfUnit.kt new file mode 100644 index 00000000000..854da8942cf --- /dev/null +++ b/compiler/testData/codegen/box/multiplatform/complexMatchings/expectCtorlessFinalToActualPromiseOfUnit.kt @@ -0,0 +1,48 @@ +// LANGUAGE: +MultiPlatformProjects +// IGNORE_BACKEND_K2: ANY +// FIR status: expect/actual in the same module +// also used as a workaround for no multi-module support in K1 box tests +// TARGET_BACKEND: JS, JS_IR, JS_IR_ES6 +// WITH_STDLIB + +// FILE: common.kt + +expect class TestResult + +expect fun createTestResult(): TestResult + +fun commonBox(): String { + val tr = createTestResult() + val tr2 = if (true) tr else createTestResult() + + if (tr != tr2) return "c01" + if (tr.hashCode() != tr2.hashCode()) return "c02" + if (tr.toString() != tr2.toString()) return "c03" + + return "O" +} + +// FILE: js.kt + +import kotlin.js.Promise + +class PromiseOfUnit(executor: (resolve: (Unit) -> Unit, reject: (Throwable) -> Unit) -> Unit) : Promise(executor) + +actual typealias TestResult = PromiseOfUnit + +actual fun createTestResult(): TestResult = PromiseOfUnit { + resolve, reject -> +} + +fun platformBox(): String { + val tr = createTestResult() + val tr2 = if (true) tr else createTestResult() + + if (tr != tr2) return "p01" + if (tr.hashCode() != tr2.hashCode()) return "p02" + if (tr.toString() != tr2.toString()) return "p03" + + return "K" +} + +fun box() = commonBox() + platformBox() diff --git a/compiler/testData/codegen/box/multiplatform/complexMatchings/expectCtorlessFinalToActualUnit.kt b/compiler/testData/codegen/box/multiplatform/complexMatchings/expectCtorlessFinalToActualUnit.kt new file mode 100644 index 00000000000..43aff54d2fc --- /dev/null +++ b/compiler/testData/codegen/box/multiplatform/complexMatchings/expectCtorlessFinalToActualUnit.kt @@ -0,0 +1,40 @@ +// LANGUAGE: +MultiPlatformProjects +// IGNORE_BACKEND_K2: ANY +// FIR status: expect/actual in the same module +// also used as a workaround for no multi-module support in K1 box tests + +// FILE: common.kt + +expect class TestResult + +expect fun createTestResult(): TestResult + +fun commonBox(): String { + val tr = createTestResult() + val tr2 = if (true) tr else createTestResult() + + if (tr != tr2) return "c01" + if (tr.hashCode() != tr2.hashCode()) return "c02" + if (tr.toString() != tr2.toString()) return "c03" + + return "O" +} + +// FILE: actual.kt + +actual typealias TestResult = Unit + +actual fun createTestResult(): TestResult = TestResult + +fun platformBox(): String { + val tr = createTestResult() + val tr2 = if (true) tr else createTestResult() + + if (tr != tr2) return "p01" + if (tr.hashCode() != tr2.hashCode()) return "p02" + if (tr.toString() != tr2.toString()) return "p03" + + return "K" +} + +fun box() = commonBox() + platformBox() diff --git a/compiler/testData/codegen/box/multiplatform/k2/complexMatchings/expectCtorlessFinalToActualObject.kt b/compiler/testData/codegen/box/multiplatform/k2/complexMatchings/expectCtorlessFinalToActualObject.kt new file mode 100644 index 00000000000..3a6b5b346c1 --- /dev/null +++ b/compiler/testData/codegen/box/multiplatform/k2/complexMatchings/expectCtorlessFinalToActualObject.kt @@ -0,0 +1,42 @@ +// LANGUAGE: +MultiPlatformProjects +// IGNORE_BACKEND_K1: ANY + +// MODULE: common +// FILE: common.kt + +expect class TestResult + +expect fun createTestResult(): TestResult + +fun commonBox(): String { + val tr = createTestResult() + val tr2 = if (true) tr else createTestResult() + + if (tr != tr2) return "c01" + if (tr.hashCode() != tr2.hashCode()) return "c02" + if (tr.toString() != tr2.toString()) return "c03" + + return "O" +} + +// MODULE: actual()()(common) +// FILE: actual.kt + +actual object TestResult { + fun doTest(): TestResult = this +} + +actual fun createTestResult(): TestResult = TestResult + +fun platformBox(): String { + val tr = createTestResult() + val tr2 = if (true) tr else createTestResult() + + if (tr != tr2) return "p01" + if (tr.hashCode() != tr2.hashCode()) return "p02" + if (tr.toString() != tr2.toString()) return "p03" + + return "K" +} + +fun box() = commonBox() + platformBox() diff --git a/compiler/testData/codegen/box/multiplatform/k2/complexMatchings/expectCtorlessFinalToActualPromiseOfUnit.kt b/compiler/testData/codegen/box/multiplatform/k2/complexMatchings/expectCtorlessFinalToActualPromiseOfUnit.kt new file mode 100644 index 00000000000..2eca1e42dc1 --- /dev/null +++ b/compiler/testData/codegen/box/multiplatform/k2/complexMatchings/expectCtorlessFinalToActualPromiseOfUnit.kt @@ -0,0 +1,48 @@ +// LANGUAGE: +MultiPlatformProjects +// IGNORE_BACKEND_K1: ANY +// TARGET_BACKEND: JS, JS_IR, JS_IR_ES6 +// WITH_STDLIB + +// MODULE: common +// FILE: common.kt + +expect class TestResult + +expect fun createTestResult(): TestResult + +fun commonBox(): String { + val tr = createTestResult() + val tr2 = if (true) tr else createTestResult() + + if (tr != tr2) return "c01" + if (tr.hashCode() != tr2.hashCode()) return "c02" + if (tr.toString() != tr2.toString()) return "c03" + + return "O" +} + +// MODULE: js()()(common) +// FILE: js.kt + +import kotlin.js.Promise + +class PromiseOfUnit(executor: (resolve: (Unit) -> Unit, reject: (Throwable) -> Unit) -> Unit) : Promise(executor) + +actual typealias TestResult = PromiseOfUnit + +actual fun createTestResult(): TestResult = PromiseOfUnit { + resolve, reject -> +} + +fun platformBox(): String { + val tr = createTestResult() + val tr2 = if (true) tr else createTestResult() + + if (tr != tr2) return "p01" + if (tr.hashCode() != tr2.hashCode()) return "p02" + if (tr.toString() != tr2.toString()) return "p03" + + return "K" +} + +fun box() = commonBox() + platformBox() diff --git a/compiler/testData/codegen/box/multiplatform/k2/complexMatchings/expectCtorlessFinalToActualUnit.kt b/compiler/testData/codegen/box/multiplatform/k2/complexMatchings/expectCtorlessFinalToActualUnit.kt new file mode 100644 index 00000000000..5d889022454 --- /dev/null +++ b/compiler/testData/codegen/box/multiplatform/k2/complexMatchings/expectCtorlessFinalToActualUnit.kt @@ -0,0 +1,40 @@ +// LANGUAGE: +MultiPlatformProjects +// IGNORE_BACKEND_K1: ANY + +// MODULE: common +// FILE: common.kt + +expect class TestResult + +expect fun createTestResult(): TestResult + +fun commonBox(): String { + val tr = createTestResult() + val tr2 = if (true) tr else createTestResult() + + if (tr != tr2) return "c01" + if (tr.hashCode() != tr2.hashCode()) return "c02" + if (tr.toString() != tr2.toString()) return "c03" + + return "O" +} + +// MODULE: actual()()(common) +// FILE: actual.kt + +actual typealias TestResult = Unit + +actual fun createTestResult(): TestResult = TestResult + +fun platformBox(): String { + val tr = createTestResult() + val tr2 = if (true) tr else createTestResult() + + if (tr != tr2) return "p01" + if (tr.hashCode() != tr2.hashCode()) return "p02" + if (tr.toString() != tr2.toString()) return "p03" + + return "K" +} + +fun box() = commonBox() + platformBox() diff --git a/compiler/testData/diagnostics/tests/multiplatform/complexMatchings/expectCtorlessFinalToActualObject.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/complexMatchings/expectCtorlessFinalToActualObject.fir.kt new file mode 100644 index 00000000000..81ac98bdee8 --- /dev/null +++ b/compiler/testData/diagnostics/tests/multiplatform/complexMatchings/expectCtorlessFinalToActualObject.fir.kt @@ -0,0 +1,47 @@ +// MODULE: m1-common +// FILE: common.kt + +expect class E01 +expect class E02() +expect open class E03 + +expect class E04 { + constructor() +} + +expect class E05(e: E01) +expect class E06 { + constructor(e: E02) +} + +expect interface I01 + +expect class M01 { + fun foo() +} + +expect enum class ENUM01 + +expect annotation class ANNO01 + +// MODULE: m2-jvm()()(m1-common) +// FILE: jvm.kt + +actual object E01 +actual object E02 +actual object E03 + +actual object E04 + +actual object E05 +actual object E06 + +actual object I01 + +actual object M01 { + actual fun foo() {} +} + +actual object ENUM01 + +actual object ANNO01 diff --git a/compiler/testData/diagnostics/tests/multiplatform/complexMatchings/expectCtorlessFinalToActualObject.kt b/compiler/testData/diagnostics/tests/multiplatform/complexMatchings/expectCtorlessFinalToActualObject.kt new file mode 100644 index 00000000000..258cd3f94f2 --- /dev/null +++ b/compiler/testData/diagnostics/tests/multiplatform/complexMatchings/expectCtorlessFinalToActualObject.kt @@ -0,0 +1,47 @@ +// MODULE: m1-common +// FILE: common.kt + +expect class E01 +expect class E02() +expect open class E03 + +expect class E04 { + constructor() +} + +expect class E05(e: E01) +expect class E06 { + constructor(e: E02) +} + +expect interface I01 + +expect class M01 { + fun foo() +} + +expect enum class ENUM01 + +expect annotation class ANNO01 + +// MODULE: m2-jvm()()(m1-common) +// FILE: jvm.kt + +actual object E01 +actual object E02 +actual object E03 + +actual object E04 + +actual object E05 +actual object E06 + +actual object I01 + +actual object M01 { + actual fun foo() {} +} + +actual object ENUM01 + +actual object ANNO01 diff --git a/compiler/testData/diagnostics/tests/multiplatform/complexMatchings/expectCtorlessFinalToActualObjectViaTypealias.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/complexMatchings/expectCtorlessFinalToActualObjectViaTypealias.fir.kt new file mode 100644 index 00000000000..d06ea9b9197 --- /dev/null +++ b/compiler/testData/diagnostics/tests/multiplatform/complexMatchings/expectCtorlessFinalToActualObjectViaTypealias.fir.kt @@ -0,0 +1,49 @@ +// MODULE: m1-common +// FILE: common.kt + +expect class E01 +expect class E02() +expect open class E03 + +expect class E04 { + constructor() +} + +expect class E05(e: E01) +expect class E06 { + constructor(e: E02) +} + +expect interface I01 + +expect class M01 { + fun foo() +} + +expect enum class ENUM01 + +expect annotation class ANNO01 + +// MODULE: m2-jvm()()(m1-common) +// FILE: jvm.kt + +object ActualObject { + fun foo() {} +} + +actual typealias E01 = ActualObject +actual typealias E02 = ActualObject +actual typealias E03 = ActualObject + +actual typealias E04 = ActualObject + +actual typealias E05 = ActualObject +actual typealias E06 = ActualObject + +actual typealias I01 = ActualObject + +actual typealias M01 = ActualObject + +actual typealias ENUM01 = ActualObject + +actual typealias ANNO01 = ActualObject diff --git a/compiler/testData/diagnostics/tests/multiplatform/complexMatchings/expectCtorlessFinalToActualObjectViaTypealias.kt b/compiler/testData/diagnostics/tests/multiplatform/complexMatchings/expectCtorlessFinalToActualObjectViaTypealias.kt new file mode 100644 index 00000000000..ea8ed4a029b --- /dev/null +++ b/compiler/testData/diagnostics/tests/multiplatform/complexMatchings/expectCtorlessFinalToActualObjectViaTypealias.kt @@ -0,0 +1,49 @@ +// MODULE: m1-common +// FILE: common.kt + +expect class E01 +expect class E02() +expect open class E03 + +expect class E04 { + constructor() +} + +expect class E05(e: E01) +expect class E06 { + constructor(e: E02) +} + +expect interface I01 + +expect class M01 { + fun foo() +} + +expect enum class ENUM01 + +expect annotation class ANNO01 + +// MODULE: m2-jvm()()(m1-common) +// FILE: jvm.kt + +object ActualObject { + fun foo() {} +} + +actual typealias E01 = ActualObject +actual typealias E02 = ActualObject +actual typealias E03 = ActualObject + +actual typealias E04 = ActualObject + +actual typealias E05 = ActualObject +actual typealias E06 = ActualObject + +actual typealias I01 = ActualObject + +actual typealias M01 = ActualObject + +actual typealias ENUM01 = ActualObject + +actual typealias ANNO01 = ActualObject diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java index 7db4d46d1a7..5c9a384e120 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java @@ -23020,6 +23020,28 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { } } + @Nested + @TestMetadata("compiler/testData/diagnostics/tests/multiplatform/complexMatchings") + @TestDataPath("$PROJECT_ROOT") + public class ComplexMatchings { + @Test + public void testAllFilesPresentInComplexMatchings() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/multiplatform/complexMatchings"), Pattern.compile("^(.*)\\.kts?$"), Pattern.compile("^(.+)\\.(reversed|fir|ll)\\.kts?$"), true); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualObject.kt") + public void testExpectCtorlessFinalToActualObject() throws Exception { + runTest("compiler/testData/diagnostics/tests/multiplatform/complexMatchings/expectCtorlessFinalToActualObject.kt"); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualObjectViaTypealias.kt") + public void testExpectCtorlessFinalToActualObjectViaTypealias() throws Exception { + runTest("compiler/testData/diagnostics/tests/multiplatform/complexMatchings/expectCtorlessFinalToActualObjectViaTypealias.kt"); + } + } + @Nested @TestMetadata("compiler/testData/diagnostics/tests/multiplatform/defaultArguments") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java index 118e5ed4f09..2dcf23052f0 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java @@ -31773,6 +31773,28 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/multiplatform/starImportOfExpectEnumWithActualTypeAlias.kt"); } + @Nested + @TestMetadata("compiler/testData/codegen/box/multiplatform/complexMatchings") + @TestDataPath("$PROJECT_ROOT") + public class ComplexMatchings { + @Test + public void testAllFilesPresentInComplexMatchings() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/complexMatchings"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualObject.kt") + public void testExpectCtorlessFinalToActualObject() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/complexMatchings/expectCtorlessFinalToActualObject.kt"); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualUnit.kt") + public void testExpectCtorlessFinalToActualUnit() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/complexMatchings/expectCtorlessFinalToActualUnit.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/multiplatform/defaultArguments") @TestDataPath("$PROJECT_ROOT") @@ -32270,6 +32292,28 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { } } + @Nested + @TestMetadata("compiler/testData/codegen/box/multiplatform/k2/complexMatchings") + @TestDataPath("$PROJECT_ROOT") + public class ComplexMatchings { + @Test + public void testAllFilesPresentInComplexMatchings() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/k2/complexMatchings"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualObject.kt") + public void testExpectCtorlessFinalToActualObject() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/complexMatchings/expectCtorlessFinalToActualObject.kt"); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualUnit.kt") + public void testExpectCtorlessFinalToActualUnit() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/complexMatchings/expectCtorlessFinalToActualUnit.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/multiplatform/k2/defaultArguments") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java index 029594fb812..efe0c66d0df 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java @@ -33417,6 +33417,28 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/multiplatform/starImportOfExpectEnumWithActualTypeAlias.kt"); } + @Nested + @TestMetadata("compiler/testData/codegen/box/multiplatform/complexMatchings") + @TestDataPath("$PROJECT_ROOT") + public class ComplexMatchings { + @Test + public void testAllFilesPresentInComplexMatchings() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/complexMatchings"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualObject.kt") + public void testExpectCtorlessFinalToActualObject() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/complexMatchings/expectCtorlessFinalToActualObject.kt"); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualUnit.kt") + public void testExpectCtorlessFinalToActualUnit() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/complexMatchings/expectCtorlessFinalToActualUnit.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/multiplatform/defaultArguments") @TestDataPath("$PROJECT_ROOT") @@ -33950,6 +33972,28 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes } } + @Nested + @TestMetadata("compiler/testData/codegen/box/multiplatform/k2/complexMatchings") + @TestDataPath("$PROJECT_ROOT") + public class ComplexMatchings { + @Test + public void testAllFilesPresentInComplexMatchings() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/k2/complexMatchings"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualObject.kt") + public void testExpectCtorlessFinalToActualObject() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/complexMatchings/expectCtorlessFinalToActualObject.kt"); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualUnit.kt") + public void testExpectCtorlessFinalToActualUnit() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/complexMatchings/expectCtorlessFinalToActualUnit.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/multiplatform/k2/defaultArguments") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java index 3024ebfbcd0..8aa5863e8bc 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java @@ -33417,6 +33417,28 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack runTest("compiler/testData/codegen/box/multiplatform/starImportOfExpectEnumWithActualTypeAlias.kt"); } + @Nested + @TestMetadata("compiler/testData/codegen/box/multiplatform/complexMatchings") + @TestDataPath("$PROJECT_ROOT") + public class ComplexMatchings { + @Test + public void testAllFilesPresentInComplexMatchings() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/complexMatchings"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualObject.kt") + public void testExpectCtorlessFinalToActualObject() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/complexMatchings/expectCtorlessFinalToActualObject.kt"); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualUnit.kt") + public void testExpectCtorlessFinalToActualUnit() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/complexMatchings/expectCtorlessFinalToActualUnit.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/multiplatform/defaultArguments") @TestDataPath("$PROJECT_ROOT") @@ -33950,6 +33972,28 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack } } + @Nested + @TestMetadata("compiler/testData/codegen/box/multiplatform/k2/complexMatchings") + @TestDataPath("$PROJECT_ROOT") + public class ComplexMatchings { + @Test + public void testAllFilesPresentInComplexMatchings() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/k2/complexMatchings"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualObject.kt") + public void testExpectCtorlessFinalToActualObject() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/complexMatchings/expectCtorlessFinalToActualObject.kt"); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualUnit.kt") + public void testExpectCtorlessFinalToActualUnit() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/complexMatchings/expectCtorlessFinalToActualUnit.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/multiplatform/k2/defaultArguments") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 18f39b0e7ae..d2719b044a1 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -28456,6 +28456,29 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/multiplatform/starImportOfExpectEnumWithActualTypeAlias.kt"); } + @TestMetadata("compiler/testData/codegen/box/multiplatform/complexMatchings") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ComplexMatchings extends AbstractLightAnalysisModeTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInComplexMatchings() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/complexMatchings"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("expectCtorlessFinalToActualObject.kt") + public void testExpectCtorlessFinalToActualObject() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/complexMatchings/expectCtorlessFinalToActualObject.kt"); + } + + @TestMetadata("expectCtorlessFinalToActualUnit.kt") + public void testExpectCtorlessFinalToActualUnit() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/complexMatchings/expectCtorlessFinalToActualUnit.kt"); + } + } + @TestMetadata("compiler/testData/codegen/box/multiplatform/defaultArguments") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) @@ -28928,6 +28951,29 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes } } + @TestMetadata("compiler/testData/codegen/box/multiplatform/k2/complexMatchings") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ComplexMatchings extends AbstractLightAnalysisModeTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInComplexMatchings() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/k2/complexMatchings"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("expectCtorlessFinalToActualObject.kt") + public void testExpectCtorlessFinalToActualObject() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/complexMatchings/expectCtorlessFinalToActualObject.kt"); + } + + @TestMetadata("expectCtorlessFinalToActualUnit.kt") + public void testExpectCtorlessFinalToActualUnit() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/complexMatchings/expectCtorlessFinalToActualUnit.kt"); + } + } + @TestMetadata("compiler/testData/codegen/box/multiplatform/k2/defaultArguments") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenBoxTestGenerated.java index 85ac663e682..ff40cd62682 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenBoxTestGenerated.java @@ -23289,6 +23289,28 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest { runTest("compiler/testData/codegen/box/multiplatform/starImportOfExpectEnumWithActualTypeAlias.kt"); } + @Nested + @TestMetadata("compiler/testData/codegen/box/multiplatform/complexMatchings") + @TestDataPath("$PROJECT_ROOT") + public class ComplexMatchings { + @Test + public void testAllFilesPresentInComplexMatchings() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/complexMatchings"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualObject.kt") + public void testExpectCtorlessFinalToActualObject() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/complexMatchings/expectCtorlessFinalToActualObject.kt"); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualUnit.kt") + public void testExpectCtorlessFinalToActualUnit() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/complexMatchings/expectCtorlessFinalToActualUnit.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/multiplatform/defaultArguments") @TestDataPath("$PROJECT_ROOT") @@ -23720,6 +23742,28 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest { } } + @Nested + @TestMetadata("compiler/testData/codegen/box/multiplatform/k2/complexMatchings") + @TestDataPath("$PROJECT_ROOT") + public class ComplexMatchings { + @Test + public void testAllFilesPresentInComplexMatchings() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/k2/complexMatchings"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualObject.kt") + public void testExpectCtorlessFinalToActualObject() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/complexMatchings/expectCtorlessFinalToActualObject.kt"); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualUnit.kt") + public void testExpectCtorlessFinalToActualUnit() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/complexMatchings/expectCtorlessFinalToActualUnit.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/multiplatform/k2/defaultArguments") @TestDataPath("$PROJECT_ROOT") diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsES6CodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsES6CodegenBoxTestGenerated.java index c39deddcc80..7f30d7a3d91 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsES6CodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsES6CodegenBoxTestGenerated.java @@ -23289,6 +23289,28 @@ public class FirJsES6CodegenBoxTestGenerated extends AbstractFirJsES6CodegenBoxT runTest("compiler/testData/codegen/box/multiplatform/starImportOfExpectEnumWithActualTypeAlias.kt"); } + @Nested + @TestMetadata("compiler/testData/codegen/box/multiplatform/complexMatchings") + @TestDataPath("$PROJECT_ROOT") + public class ComplexMatchings { + @Test + public void testAllFilesPresentInComplexMatchings() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/complexMatchings"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualObject.kt") + public void testExpectCtorlessFinalToActualObject() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/complexMatchings/expectCtorlessFinalToActualObject.kt"); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualUnit.kt") + public void testExpectCtorlessFinalToActualUnit() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/complexMatchings/expectCtorlessFinalToActualUnit.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/multiplatform/defaultArguments") @TestDataPath("$PROJECT_ROOT") @@ -23720,6 +23742,28 @@ public class FirJsES6CodegenBoxTestGenerated extends AbstractFirJsES6CodegenBoxT } } + @Nested + @TestMetadata("compiler/testData/codegen/box/multiplatform/k2/complexMatchings") + @TestDataPath("$PROJECT_ROOT") + public class ComplexMatchings { + @Test + public void testAllFilesPresentInComplexMatchings() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/k2/complexMatchings"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualObject.kt") + public void testExpectCtorlessFinalToActualObject() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/complexMatchings/expectCtorlessFinalToActualObject.kt"); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualUnit.kt") + public void testExpectCtorlessFinalToActualUnit() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/complexMatchings/expectCtorlessFinalToActualUnit.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/multiplatform/k2/defaultArguments") @TestDataPath("$PROJECT_ROOT") diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java index 8f9965b7fba..2494b143f4c 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java @@ -23289,6 +23289,28 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/multiplatform/starImportOfExpectEnumWithActualTypeAlias.kt"); } + @Nested + @TestMetadata("compiler/testData/codegen/box/multiplatform/complexMatchings") + @TestDataPath("$PROJECT_ROOT") + public class ComplexMatchings { + @Test + public void testAllFilesPresentInComplexMatchings() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/complexMatchings"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualObject.kt") + public void testExpectCtorlessFinalToActualObject() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/complexMatchings/expectCtorlessFinalToActualObject.kt"); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualUnit.kt") + public void testExpectCtorlessFinalToActualUnit() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/complexMatchings/expectCtorlessFinalToActualUnit.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/multiplatform/defaultArguments") @TestDataPath("$PROJECT_ROOT") @@ -23720,6 +23742,28 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { } } + @Nested + @TestMetadata("compiler/testData/codegen/box/multiplatform/k2/complexMatchings") + @TestDataPath("$PROJECT_ROOT") + public class ComplexMatchings { + @Test + public void testAllFilesPresentInComplexMatchings() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/k2/complexMatchings"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualObject.kt") + public void testExpectCtorlessFinalToActualObject() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/complexMatchings/expectCtorlessFinalToActualObject.kt"); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualUnit.kt") + public void testExpectCtorlessFinalToActualUnit() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/complexMatchings/expectCtorlessFinalToActualUnit.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/multiplatform/k2/defaultArguments") @TestDataPath("$PROJECT_ROOT") diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenBoxTestGenerated.java index 6f90a87ba38..5ab9db6793a 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenBoxTestGenerated.java @@ -23289,6 +23289,28 @@ public class IrJsES6CodegenBoxTestGenerated extends AbstractIrJsES6CodegenBoxTes runTest("compiler/testData/codegen/box/multiplatform/starImportOfExpectEnumWithActualTypeAlias.kt"); } + @Nested + @TestMetadata("compiler/testData/codegen/box/multiplatform/complexMatchings") + @TestDataPath("$PROJECT_ROOT") + public class ComplexMatchings { + @Test + public void testAllFilesPresentInComplexMatchings() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/complexMatchings"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualObject.kt") + public void testExpectCtorlessFinalToActualObject() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/complexMatchings/expectCtorlessFinalToActualObject.kt"); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualUnit.kt") + public void testExpectCtorlessFinalToActualUnit() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/complexMatchings/expectCtorlessFinalToActualUnit.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/multiplatform/defaultArguments") @TestDataPath("$PROJECT_ROOT") @@ -23720,6 +23742,28 @@ public class IrJsES6CodegenBoxTestGenerated extends AbstractIrJsES6CodegenBoxTes } } + @Nested + @TestMetadata("compiler/testData/codegen/box/multiplatform/k2/complexMatchings") + @TestDataPath("$PROJECT_ROOT") + public class ComplexMatchings { + @Test + public void testAllFilesPresentInComplexMatchings() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/k2/complexMatchings"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualObject.kt") + public void testExpectCtorlessFinalToActualObject() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/complexMatchings/expectCtorlessFinalToActualObject.kt"); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualUnit.kt") + public void testExpectCtorlessFinalToActualUnit() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/complexMatchings/expectCtorlessFinalToActualUnit.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/multiplatform/k2/defaultArguments") @TestDataPath("$PROJECT_ROOT") diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestGenerated.java index 0e3d8f51bed..7fc2b9aad28 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestGenerated.java @@ -26237,6 +26237,31 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe runTest("compiler/testData/codegen/box/multiplatform/starImportOfExpectEnumWithActualTypeAlias.kt"); } + @Nested + @TestMetadata("compiler/testData/codegen/box/multiplatform/complexMatchings") + @TestDataPath("$PROJECT_ROOT") + @Tag("frontend-fir") + @FirPipeline() + @UseExtTestCaseGroupProvider() + public class ComplexMatchings { + @Test + public void testAllFilesPresentInComplexMatchings() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/complexMatchings"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualObject.kt") + public void testExpectCtorlessFinalToActualObject() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/complexMatchings/expectCtorlessFinalToActualObject.kt"); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualUnit.kt") + public void testExpectCtorlessFinalToActualUnit() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/complexMatchings/expectCtorlessFinalToActualUnit.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/multiplatform/defaultArguments") @TestDataPath("$PROJECT_ROOT") @@ -26692,6 +26717,31 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe } } + @Nested + @TestMetadata("compiler/testData/codegen/box/multiplatform/k2/complexMatchings") + @TestDataPath("$PROJECT_ROOT") + @Tag("frontend-fir") + @FirPipeline() + @UseExtTestCaseGroupProvider() + public class ComplexMatchings { + @Test + public void testAllFilesPresentInComplexMatchings() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/k2/complexMatchings"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualObject.kt") + public void testExpectCtorlessFinalToActualObject() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/complexMatchings/expectCtorlessFinalToActualObject.kt"); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualUnit.kt") + public void testExpectCtorlessFinalToActualUnit() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/complexMatchings/expectCtorlessFinalToActualUnit.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/multiplatform/k2/defaultArguments") @TestDataPath("$PROJECT_ROOT") diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestNoPLGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestNoPLGenerated.java index 01a06ba1e58..6a149fd9b1e 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestNoPLGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/FirNativeCodegenBoxTestNoPLGenerated.java @@ -26839,6 +26839,33 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB runTest("compiler/testData/codegen/box/multiplatform/starImportOfExpectEnumWithActualTypeAlias.kt"); } + @Nested + @TestMetadata("compiler/testData/codegen/box/multiplatform/complexMatchings") + @TestDataPath("$PROJECT_ROOT") + @Tag("frontend-fir") + @FirPipeline() + @UseExtTestCaseGroupProvider() + @UsePartialLinkage(mode = Mode.DISABLED) + @Tag("no-partial-linkage-may-be-skipped") + public class ComplexMatchings { + @Test + public void testAllFilesPresentInComplexMatchings() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/complexMatchings"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualObject.kt") + public void testExpectCtorlessFinalToActualObject() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/complexMatchings/expectCtorlessFinalToActualObject.kt"); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualUnit.kt") + public void testExpectCtorlessFinalToActualUnit() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/complexMatchings/expectCtorlessFinalToActualUnit.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/multiplatform/defaultArguments") @TestDataPath("$PROJECT_ROOT") @@ -27306,6 +27333,33 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB } } + @Nested + @TestMetadata("compiler/testData/codegen/box/multiplatform/k2/complexMatchings") + @TestDataPath("$PROJECT_ROOT") + @Tag("frontend-fir") + @FirPipeline() + @UseExtTestCaseGroupProvider() + @UsePartialLinkage(mode = Mode.DISABLED) + @Tag("no-partial-linkage-may-be-skipped") + public class ComplexMatchings { + @Test + public void testAllFilesPresentInComplexMatchings() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/k2/complexMatchings"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualObject.kt") + public void testExpectCtorlessFinalToActualObject() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/complexMatchings/expectCtorlessFinalToActualObject.kt"); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualUnit.kt") + public void testExpectCtorlessFinalToActualUnit() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/complexMatchings/expectCtorlessFinalToActualUnit.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/multiplatform/k2/defaultArguments") @TestDataPath("$PROJECT_ROOT") diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestGenerated.java index 180c0c095ba..3502201ca15 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestGenerated.java @@ -25937,6 +25937,30 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest runTest("compiler/testData/codegen/box/multiplatform/starImportOfExpectEnumWithActualTypeAlias.kt"); } + @Nested + @TestMetadata("compiler/testData/codegen/box/multiplatform/complexMatchings") + @TestDataPath("$PROJECT_ROOT") + @UseExtTestCaseGroupProvider() + @DisabledTestsIfProperty(sourceLocations = { "compiler/testData/codegen/box/coroutines/featureIntersection/defaultExpect.kt", "compiler/testData/codegen/box/multiplatform/defaultArguments/*.kt", "compiler/testData/codegen/box/multiplatform/migratedOldTests/*.kt", "compiler/testData/codegen/boxInline/multiplatform/defaultArguments/receiversAndParametersInLambda.kt" }, property = ClassLevelProperty.TEST_MODE, propertyValue = "ONE_STAGE_MULTI_MODULE") + public class ComplexMatchings { + @Test + public void testAllFilesPresentInComplexMatchings() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/complexMatchings"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualObject.kt") + public void testExpectCtorlessFinalToActualObject() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/complexMatchings/expectCtorlessFinalToActualObject.kt"); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualUnit.kt") + public void testExpectCtorlessFinalToActualUnit() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/complexMatchings/expectCtorlessFinalToActualUnit.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/multiplatform/defaultArguments") @TestDataPath("$PROJECT_ROOT") @@ -26386,6 +26410,30 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest } } + @Nested + @TestMetadata("compiler/testData/codegen/box/multiplatform/k2/complexMatchings") + @TestDataPath("$PROJECT_ROOT") + @UseExtTestCaseGroupProvider() + @DisabledTestsIfProperty(sourceLocations = { "compiler/testData/codegen/box/coroutines/featureIntersection/defaultExpect.kt", "compiler/testData/codegen/box/multiplatform/defaultArguments/*.kt", "compiler/testData/codegen/box/multiplatform/migratedOldTests/*.kt", "compiler/testData/codegen/boxInline/multiplatform/defaultArguments/receiversAndParametersInLambda.kt" }, property = ClassLevelProperty.TEST_MODE, propertyValue = "ONE_STAGE_MULTI_MODULE") + public class ComplexMatchings { + @Test + public void testAllFilesPresentInComplexMatchings() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/k2/complexMatchings"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualObject.kt") + public void testExpectCtorlessFinalToActualObject() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/complexMatchings/expectCtorlessFinalToActualObject.kt"); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualUnit.kt") + public void testExpectCtorlessFinalToActualUnit() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/complexMatchings/expectCtorlessFinalToActualUnit.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/multiplatform/k2/defaultArguments") @TestDataPath("$PROJECT_ROOT") diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestNoPLGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestNoPLGenerated.java index 1fdc619e184..18cb8ccbc40 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestNoPLGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestNoPLGenerated.java @@ -26238,6 +26238,31 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT runTest("compiler/testData/codegen/box/multiplatform/starImportOfExpectEnumWithActualTypeAlias.kt"); } + @Nested + @TestMetadata("compiler/testData/codegen/box/multiplatform/complexMatchings") + @TestDataPath("$PROJECT_ROOT") + @UseExtTestCaseGroupProvider() + @UsePartialLinkage(mode = Mode.DISABLED) + @Tag("no-partial-linkage-may-be-skipped") + public class ComplexMatchings { + @Test + public void testAllFilesPresentInComplexMatchings() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/complexMatchings"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualObject.kt") + public void testExpectCtorlessFinalToActualObject() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/complexMatchings/expectCtorlessFinalToActualObject.kt"); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualUnit.kt") + public void testExpectCtorlessFinalToActualUnit() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/complexMatchings/expectCtorlessFinalToActualUnit.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/multiplatform/defaultArguments") @TestDataPath("$PROJECT_ROOT") @@ -26693,6 +26718,31 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT } } + @Nested + @TestMetadata("compiler/testData/codegen/box/multiplatform/k2/complexMatchings") + @TestDataPath("$PROJECT_ROOT") + @UseExtTestCaseGroupProvider() + @UsePartialLinkage(mode = Mode.DISABLED) + @Tag("no-partial-linkage-may-be-skipped") + public class ComplexMatchings { + @Test + public void testAllFilesPresentInComplexMatchings() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/k2/complexMatchings"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualObject.kt") + public void testExpectCtorlessFinalToActualObject() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/complexMatchings/expectCtorlessFinalToActualObject.kt"); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualUnit.kt") + public void testExpectCtorlessFinalToActualUnit() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/complexMatchings/expectCtorlessFinalToActualUnit.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/multiplatform/k2/defaultArguments") @TestDataPath("$PROJECT_ROOT") diff --git a/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/FirWasmCodegenBoxTestGenerated.java b/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/FirWasmCodegenBoxTestGenerated.java index 275aa7ebbd5..92b9dc9d4a6 100644 --- a/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/FirWasmCodegenBoxTestGenerated.java +++ b/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/FirWasmCodegenBoxTestGenerated.java @@ -23037,6 +23037,28 @@ public class FirWasmCodegenBoxTestGenerated extends AbstractFirWasmCodegenBoxTes runTest("compiler/testData/codegen/box/multiplatform/starImportOfExpectEnumWithActualTypeAlias.kt"); } + @Nested + @TestMetadata("compiler/testData/codegen/box/multiplatform/complexMatchings") + @TestDataPath("$PROJECT_ROOT") + public class ComplexMatchings { + @Test + public void testAllFilesPresentInComplexMatchings() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/complexMatchings"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualObject.kt") + public void testExpectCtorlessFinalToActualObject() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/complexMatchings/expectCtorlessFinalToActualObject.kt"); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualUnit.kt") + public void testExpectCtorlessFinalToActualUnit() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/complexMatchings/expectCtorlessFinalToActualUnit.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/multiplatform/defaultArguments") @TestDataPath("$PROJECT_ROOT") @@ -23468,6 +23490,28 @@ public class FirWasmCodegenBoxTestGenerated extends AbstractFirWasmCodegenBoxTes } } + @Nested + @TestMetadata("compiler/testData/codegen/box/multiplatform/k2/complexMatchings") + @TestDataPath("$PROJECT_ROOT") + public class ComplexMatchings { + @Test + public void testAllFilesPresentInComplexMatchings() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/k2/complexMatchings"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualObject.kt") + public void testExpectCtorlessFinalToActualObject() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/complexMatchings/expectCtorlessFinalToActualObject.kt"); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualUnit.kt") + public void testExpectCtorlessFinalToActualUnit() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/complexMatchings/expectCtorlessFinalToActualUnit.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/multiplatform/k2/defaultArguments") @TestDataPath("$PROJECT_ROOT") diff --git a/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/K1WasmCodegenBoxTestGenerated.java b/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/K1WasmCodegenBoxTestGenerated.java index c168940bbc4..2847477986d 100644 --- a/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/K1WasmCodegenBoxTestGenerated.java +++ b/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/K1WasmCodegenBoxTestGenerated.java @@ -23037,6 +23037,28 @@ public class K1WasmCodegenBoxTestGenerated extends AbstractK1WasmCodegenBoxTest runTest("compiler/testData/codegen/box/multiplatform/starImportOfExpectEnumWithActualTypeAlias.kt"); } + @Nested + @TestMetadata("compiler/testData/codegen/box/multiplatform/complexMatchings") + @TestDataPath("$PROJECT_ROOT") + public class ComplexMatchings { + @Test + public void testAllFilesPresentInComplexMatchings() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/complexMatchings"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualObject.kt") + public void testExpectCtorlessFinalToActualObject() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/complexMatchings/expectCtorlessFinalToActualObject.kt"); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualUnit.kt") + public void testExpectCtorlessFinalToActualUnit() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/complexMatchings/expectCtorlessFinalToActualUnit.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/multiplatform/defaultArguments") @TestDataPath("$PROJECT_ROOT") @@ -23468,6 +23490,28 @@ public class K1WasmCodegenBoxTestGenerated extends AbstractK1WasmCodegenBoxTest } } + @Nested + @TestMetadata("compiler/testData/codegen/box/multiplatform/k2/complexMatchings") + @TestDataPath("$PROJECT_ROOT") + public class ComplexMatchings { + @Test + public void testAllFilesPresentInComplexMatchings() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/k2/complexMatchings"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualObject.kt") + public void testExpectCtorlessFinalToActualObject() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/complexMatchings/expectCtorlessFinalToActualObject.kt"); + } + + @Test + @TestMetadata("expectCtorlessFinalToActualUnit.kt") + public void testExpectCtorlessFinalToActualUnit() throws Exception { + runTest("compiler/testData/codegen/box/multiplatform/k2/complexMatchings/expectCtorlessFinalToActualUnit.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/multiplatform/k2/defaultArguments") @TestDataPath("$PROJECT_ROOT")