K2: discriminate particular SAMs in the first place in ConeOverloadConflictResolver

Before this commit, we discriminated particular candidates with SAM
during resolution stages. More precisely, candidates from Kotlin
which used Java SAM types, were discriminated allowing go up the tower
for better candidates. After disabling compatibility mode for new
inference, it's not so, but now we discriminate similar candidates
in ConeOverloadConflictResolver. This does not allow going up the tower,
but allows to select better candidate at similar tower level.

Related to KT-63558, KT-64306
This commit is contained in:
Mikhail Glukhikh
2023-12-18 16:45:39 +01:00
committed by Space Team
parent a7dc381b93
commit 087edc026d
13 changed files with 70 additions and 9 deletions
@@ -32476,6 +32476,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
runTest("compiler/testData/diagnostics/tests/samConversions/samPriorityVsGenericCompatibilityDisabled.kt");
}
@Test
@TestMetadata("samPriorityVsGenericCompatibilityEnabled.kt")
public void testSamPriorityVsGenericCompatibilityEnabled() throws Exception {
runTest("compiler/testData/diagnostics/tests/samConversions/samPriorityVsGenericCompatibilityEnabled.kt");
}
@Test
@TestMetadata("sameCandidatesFromKotlinAndJavaInOneScope.kt")
public void testSameCandidatesFromKotlinAndJavaInOneScope() throws Exception {
@@ -32476,6 +32476,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
runTest("compiler/testData/diagnostics/tests/samConversions/samPriorityVsGenericCompatibilityDisabled.kt");
}
@Test
@TestMetadata("samPriorityVsGenericCompatibilityEnabled.kt")
public void testSamPriorityVsGenericCompatibilityEnabled() throws Exception {
runTest("compiler/testData/diagnostics/tests/samConversions/samPriorityVsGenericCompatibilityEnabled.kt");
}
@Test
@TestMetadata("sameCandidatesFromKotlinAndJavaInOneScope.kt")
public void testSameCandidatesFromKotlinAndJavaInOneScope() throws Exception {