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