[FIR, IR] 1/2 Align FirExpectActualMatchingContextImpl.areCompatibleExpectActualTypes with ExpectActualUtilsKt.areCompatibleExpectActualTypes

Those two functions are copy-paste of each other. They diverged since
the time they were copy-pasted. This commit makes
FirExpectActualMatchingContextImpl.areCompatibleExpectActualTypes
up-to-date.

I didn't update ExpectActualUtilsKt.areCompatibleExpectActualTypes
because I will drop it in the next commit.

Change in `dynamicTypesEqualToAnything` doesn't change any logic (yet.
This change in logic will take effect in the next commit), because:
1. `dynamicTypesEqualToAnything` is only changed in
AbstractExpectActualChecker.getCallablesCheckingIncompatibility. But
AbstractExpectActualChecker.getCallablesCheckingIncompatibility doesn't
check return types on frontend (it only check return types on backend).
2. `dynamicTypesEqualToAnything` is ignored on IR backend

I have no idea what is the difference between `createTypeCheckerState()`
and `actualSession.typeContext`, but it aligns these copy-pasted
versions and makes the tests behave like in K1 (at least
'typeUsageWithUnresolvedReference' and 'kt57320' are affected)

This commit is mainly a preparation for the next commit.

Review: https://jetbrains.team/p/kt/reviews/12750/timeline
This commit is contained in:
Nikita Bobko
2023-10-25 20:43:23 +02:00
committed by teamcity
parent ddc1ae9ac6
commit a9583e4f9a
6 changed files with 17 additions and 4 deletions
@@ -7,4 +7,4 @@ annotation class Ann
// MODULE: m1-jvm()()(m1-common)
// FILE: jvm.kt
actual fun <T : <!UNRESOLVED_REFERENCE!>Unresolved<!>> foo() {}
actual fun <T : <!UNRESOLVED_REFERENCE!>Unresolved<!>> <!ACTUAL_WITHOUT_EXPECT!>foo<!>() {}