[FE] Prohibit default arguments in expect declarations actualized via typealias

Cases when default argument inhertied from super class are allowed.

Some tests for default arguments already exist and can be found in
`testData/diagnostics/tests/multiplatform/defaultArguments`, for example
`annotationsViaActualTypeAlias.kt`.

^KT-57614 Fixed

Merge-request: KT-MR-10356
Merged-by: Roman Efremov <Roman.Efremov@jetbrains.com>
This commit is contained in:
Roman Efremov
2023-05-31 13:14:37 +00:00
committed by Space Team
parent 9829a2bf98
commit d2eb4a0abf
34 changed files with 284 additions and 174 deletions
@@ -365,11 +365,29 @@ public class MultiPlatformIntegrationTestGenerated extends AbstractMultiPlatform
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/multiplatform/defaultArguments"), Pattern.compile("^([^\\.]+)$"), null, true);
}
@TestMetadata("methodDefaultArgsViaTypealias")
public void testMethodDefaultArgsViaTypealias() throws Exception {
runTest("compiler/testData/multiplatform/defaultArguments/methodDefaultArgsViaTypealias/");
}
@TestMetadata("useDefaultArgumentsInDependency")
public void testUseDefaultArgumentsInDependency() throws Exception {
runTest("compiler/testData/multiplatform/defaultArguments/useDefaultArgumentsInDependency/");
}
@TestMetadata("compiler/testData/multiplatform/defaultArguments/methodDefaultArgsViaTypealias")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class MethodDefaultArgsViaTypealias extends AbstractMultiPlatformIntegrationTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInMethodDefaultArgsViaTypealias() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/multiplatform/defaultArguments/methodDefaultArgsViaTypealias"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("compiler/testData/multiplatform/defaultArguments/useDefaultArgumentsInDependency")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)