K2: Fix priority for implicit receiver + extensionInvoke

See K1 counterpart at org.jetbrains.kotlin.resolve.calls.tower.TowerResolver.Task.processImplicitReceiver

^KT-58943 Fixed
^KT-59541 Fixed
This commit is contained in:
Denis.Zharkov
2023-05-26 18:35:24 +02:00
committed by Space Team
parent 1f120ecd20
commit 3279313f2c
24 changed files with 160 additions and 31 deletions
@@ -1,16 +0,0 @@
// ISSUE: KT-58943
class A {
fun bar() {
val foo: String.() -> Int = { 1 } // (1)
fun String.foo(): String = "" // (2)
with("2") {
// In K1, foo variable + invokeExtension on implicit receiver is more prioritized than `foo() + implicit receiver`
// So, for now, we're going to preserve that behavior in K2
// For design, see KT-59528
takeInt(<!ARGUMENT_TYPE_MISMATCH!>foo()<!>)
}
}
}
fun takeInt(x: Int) {}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// ISSUE: KT-58943
class A {