[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
@@ -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")
@@ -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")
@@ -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")
@@ -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")