[FIR] Properly generate implicit invoke calls for a.(b)()
^KT-64891 Fixed
This commit is contained in:
committed by
Space Team
parent
8e6e447d6d
commit
3a36a786d4
@@ -1,16 +0,0 @@
|
||||
// ISSUE: KT-64891
|
||||
|
||||
val b: Int.() -> Int = { 10 }
|
||||
val Int.b: () -> String get() = { "B" }
|
||||
|
||||
fun main() {
|
||||
5.(b)().<!UNRESOLVED_REFERENCE!>inv<!>() // should be Int
|
||||
5.b().length // should be String
|
||||
}
|
||||
|
||||
fun <T> id(it: T) = it
|
||||
|
||||
fun rain() {
|
||||
5.(b)().<!UNRESOLVED_REFERENCE!>inv<!>()
|
||||
5.(id(b))().inv() // should be consistent
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// ISSUE: KT-64891
|
||||
|
||||
val b: Int.() -> Int = { 10 }
|
||||
|
||||
Vendored
+1
-1
@@ -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<!>)
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -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!>()<!>
|
||||
}
|
||||
|
||||
|
||||
Vendored
+2
-2
@@ -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)()
|
||||
|
||||
|
||||
+2
-2
@@ -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<!>)()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user