FIR IDE: use KtVariableWithInvokeFunctionCall for extension invoke

This commit is contained in:
Tianyu Geng
2021-08-30 11:33:30 -07:00
committed by Ilya Kirillov
parent c19ed07fd1
commit 9ca8d39240
9 changed files with 27 additions and 7 deletions
@@ -1,5 +1,5 @@
operator fun Int.invoke(): String {}
fun call(x: kotlin.int) {
fun call(x: kotlin.Int) {
<expr>x()</expr>
}
@@ -1,4 +1,5 @@
KtFunctionCall:
KtVariableWithInvokeFunctionCall:
target = x: kotlin.Int
argumentMapping = { }
targetFunction = /invoke(<extension receiver>: kotlin.Int): kotlin.String
substitutor = <empty substitutor>
@@ -0,0 +1,7 @@
interface Foo
operator fun <T> Foo.invoke(t: T) {}
fun test(f: Foo) {
<expr>f("")</expr>
}
@@ -0,0 +1,5 @@
KtVariableWithInvokeFunctionCall:
target = f: Foo
argumentMapping = { "" -> (t: kotlin.String) }
targetFunction = /invoke(<extension receiver>: Foo, t: kotlin.String): kotlin.Unit
substitutor = <map substitutor: {FirTypeParameterSymbol T=kotlin/String}>