[FIR] fix resolution ambiguities between weakly compatible expect and actual

There is a corresponding example inside the stdlib,
see `kotlin.text.startsWith`.

JVM and common counterpart are weakly-compatible
as the actual declaration has default arguments,
which results in `ExpectActualCompatibility.Incompatible.ActualFunctionWithDefaultParameters`

This commit allows such cases.

^KT-61732 fixed
This commit is contained in:
Ilya Kirillov
2023-09-06 10:54:12 +02:00
committed by Space Team
parent 209d59440b
commit 030250d387
8 changed files with 101 additions and 1 deletions
@@ -97,6 +97,12 @@ public class FirOldFrontendMPPDiagnosticsWithLightTreeTestGenerated extends Abst
runTest("compiler/testData/diagnostics/tests/multiplatform/arraySortFixed.kt");
}
@Test
@TestMetadata("callConflictsOnExpectAndActualWeaklyCompatible.kt")
public void testCallConflictsOnExpectAndActualWeaklyCompatible() throws Exception {
runTest("compiler/testData/diagnostics/tests/multiplatform/callConflictsOnExpectAndActualWeaklyCompatible.kt");
}
@Test
@TestMetadata("checkNoActualForExpectInLastModule.kt")
public void testCheckNoActualForExpectInLastModule() throws Exception {
@@ -97,6 +97,12 @@ public class FirOldFrontendMPPDiagnosticsWithPsiTestGenerated extends AbstractFi
runTest("compiler/testData/diagnostics/tests/multiplatform/arraySortFixed.kt");
}
@Test
@TestMetadata("callConflictsOnExpectAndActualWeaklyCompatible.kt")
public void testCallConflictsOnExpectAndActualWeaklyCompatible() throws Exception {
runTest("compiler/testData/diagnostics/tests/multiplatform/callConflictsOnExpectAndActualWeaklyCompatible.kt");
}
@Test
@TestMetadata("checkNoActualForExpectInLastModule.kt")
public void testCheckNoActualForExpectInLastModule() throws Exception {