[FIR] Properly generate implicit invoke calls for a.(b)()

^KT-64891 Fixed
This commit is contained in:
Nikolay Lunyak
2024-01-15 12:57:27 +02:00
committed by Space Team
parent 8e6e447d6d
commit 3a36a786d4
9 changed files with 44 additions and 45 deletions
@@ -7,5 +7,5 @@ fun test1(f: String.() -> Unit) {
fun test2(f: (Int) -> Int) {
1.<!UNRESOLVED_REFERENCE!>f<!>(2)
2.(<!UNRESOLVED_REFERENCE!>f<!>)(2)
2.(f)(<!TOO_MANY_ARGUMENTS!>2<!>)
}
@@ -5,7 +5,7 @@ fun test1() {
}
fun test2(f: String.(Int) -> Unit) {
11.(<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>f<!>)(1)
11.<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>(f)<!>(1)
11.(f)<!NO_VALUE_FOR_PARAMETER!>()<!>
}
@@ -24,7 +24,7 @@ fun test(a: A, b: B) {
with(b) {
a.foo<!NO_VALUE_FOR_PARAMETER!>()<!>
a.(foo)<!NO_VALUE_FOR_PARAMETER!>()<!>
<!TOO_MANY_ARGUMENTS!>a<!>.(<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>foo<!>)()
(a.foo)()
@@ -66,7 +66,7 @@ fun test(a: A, b: B) {
with(b) {
a.foo<!NO_VALUE_FOR_PARAMETER!>()<!>
a.(foo)<!NO_VALUE_FOR_PARAMETER!>()<!>
a.(<!UNRESOLVED_REFERENCE!>foo<!>)()
(a.foo)()
@@ -10,10 +10,10 @@ val B.a: () -> Int get() = { 5 }
fun test(a: A, b: B) {
val x: Int = b.a()
b.(a)()
b.(<!UNRESOLVED_REFERENCE!>a<!>)()
with(b) {
val y: Int = a()
(a)()
(<!UNRESOLVED_REFERENCE!>a<!>)()
}
}