[FE] Fix TypeParameterUpperBounds incompatibility priority

^KT-60902 Fixed
Review: https://jetbrains.team/p/kt/reviews/11039/timeline

We should prioritize to return STRONG incompatibilities over WEAK
incompatibilities. But this invariant broke in `areCompatibleCallables`,
because `areCompatibleTypeParameters` returns incompatibilities of both
types, and `areCompatibleTypeParameters` is called in WEAK
incompatibilities section.

The fix is to split `areCompatibleTypeParameters` into two functions:
`areStrongIncompatibleTypeParameters` and
`areWeakIncompatibleTypeParameters`. And call each of this function in
appropriate `areCompatibleCallables` sections.
This commit is contained in:
Nikita Bobko
2023-08-02 19:12:41 +02:00
committed by teamcity
parent fd5e97ff23
commit eac4b81b11
5 changed files with 59 additions and 7 deletions
@@ -205,6 +205,12 @@ public class FirOldFrontendMPPDiagnosticsWithLightTreeTestGenerated extends Abst
runTest("compiler/testData/diagnostics/tests/multiplatform/kt58153.kt");
}
@Test
@TestMetadata("kt60902.kt")
public void testKt60902() throws Exception {
runTest("compiler/testData/diagnostics/tests/multiplatform/kt60902.kt");
}
@Test
@TestMetadata("manyImplMemberNotImplemented.kt")
public void testManyImplMemberNotImplemented() throws Exception {
@@ -205,6 +205,12 @@ public class FirOldFrontendMPPDiagnosticsWithPsiTestGenerated extends AbstractFi
runTest("compiler/testData/diagnostics/tests/multiplatform/kt58153.kt");
}
@Test
@TestMetadata("kt60902.kt")
public void testKt60902() throws Exception {
runTest("compiler/testData/diagnostics/tests/multiplatform/kt60902.kt");
}
@Test
@TestMetadata("manyImplMemberNotImplemented.kt")
public void testManyImplMemberNotImplemented() throws Exception {