Fir incorrect usage of AbstractExpectActualCompatibilityChecker.getCallablesCompatibility API

^KT-62027 Fixed

`getCallablesCompatibility` requires parentSubstitutor as a parameter,
but we created a member-level substitutor

`getCallablesCompatibility` will create member-level substitutor itself,
no need to create member-level substitutor on the call site.

IndexOutOfBounds was happening in an attempt of creating member-level
substitutor

I will refactor the `createExpectActualTypeParameterSubstitutor` API in
the following commits later. It will help to avoid problems like that
This commit is contained in:
Nikita Bobko
2023-09-19 12:18:42 +02:00
committed by Space Team
parent 9ff3871a8b
commit b15787bfa8
6 changed files with 50 additions and 6 deletions
@@ -0,0 +1,14 @@
// MODULE: m1-common
// FILE: common.kt
expect open class Foo {
fun <T> foo(t: T)
}
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
actual open class Foo {
actual fun <T> foo(t: T) {}
fun foo(t: String) {}
}
@@ -0,0 +1,14 @@
// MODULE: m1-common
// FILE: common.kt
expect open class Foo {
fun <T> foo(t: T)
}
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
actual open <!ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_MEMBERS_AS_NON_FINAL_EXPECT_CLASSIFIER!>class Foo<!> {
actual fun <T> foo(t: T) {}
fun <!NON_ACTUAL_MEMBER_DECLARED_IN_EXPECT_NON_FINAL_CLASSIFIER_ACTUALIZATION!>foo<!>(t: String) {}
}