[KMP] Allow matching expect ctorless final classes to objects

both directly and via typealias.

This is a possible fix to KT-59747
This commit is contained in:
marat.akhin
2023-07-20 18:16:06 +02:00
committed by Space Team
parent 6df9ce23f7
commit ae4fab8483
30 changed files with 1273 additions and 1 deletions
@@ -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")
@@ -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")
@@ -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")
@@ -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")