K2: Fix false-positive OVERLOAD_RESOLUTION_AMBIGUITY

It's been introduced in the previous commit
("K2: Simplify handling mixed smartcast vs. original candidates")

Because previously, it was assumed wrongly that each next level of
ConeCallConflictResolver filter out the candidates that are 100% less
applicable/specific, but the main one (ConeOverloadConflictResolver)
either leaves the single candidate or the whole same set, thus at
FilteringOutOriginalInPresenceOfSmartCastConeCallConflictResolver
we've got 4 candidates only two of which we might filter out.
This commit is contained in:
Denis.Zharkov
2023-02-10 17:30:03 +01:00
committed by Space Team
parent 1e1d122dd3
commit b4b443034f
11 changed files with 169 additions and 88 deletions
@@ -23422,6 +23422,18 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
runTest("compiler/testData/diagnostics/tests/overload/OverloadVarAndFunInClass.kt");
}
@Test
@TestMetadata("overloadsFromCurrentAndSuperClass.kt")
public void testOverloadsFromCurrentAndSuperClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/overload/overloadsFromCurrentAndSuperClass.kt");
}
@Test
@TestMetadata("overloadsFromCurrentAndSuperClassWithReturnType.kt")
public void testOverloadsFromCurrentAndSuperClassWithReturnType() throws Exception {
runTest("compiler/testData/diagnostics/tests/overload/overloadsFromCurrentAndSuperClassWithReturnType.kt");
}
@Test
@TestMetadata("SyntheticAndNotSynthetic.kt")
public void testSyntheticAndNotSynthetic() throws Exception {