KTIJ-27434 [AA] Unwrap safe call expression when resolving implicit invoke calls

`FirSafeCallExpression` does not implement `FirResolvable`, so we need
to unwrap it to correctly resolve calls like `foo?.bar()` when `bar` is
a lambda with receiver parameter or a functional type property

^KTIJ-27434 Fixed
This commit is contained in:
Roman Golyshev
2023-10-19 18:40:07 +02:00
committed by teamcity
parent 86fd889138
commit 0747fc36de
19 changed files with 252 additions and 3 deletions
@@ -0,0 +1,9 @@
package test
class Foo
val Foo.action: () -> Unit get() = {}
fun usage(foo: Foo) {
foo.acti<caret>on()
}
@@ -0,0 +1,2 @@
Resolved to:
0: (in test) val test.Foo.action: () -> kotlin.Unit
@@ -0,0 +1,9 @@
package test
class Foo
val Foo.action: () -> Unit get() = {}
fun usage(foo: Foo?) {
foo?.acti<caret>on()
}
@@ -0,0 +1,2 @@
Resolved to:
0: (in test) val test.Foo.action: () -> kotlin.Unit
@@ -0,0 +1,7 @@
package test
class Foo
fun usage(foo: Foo, action: Foo.() -> Unit) {
foo.acti<caret>on()
}
@@ -0,0 +1,2 @@
Resolved to:
0: action: test.Foo.() -> kotlin.Unit
@@ -0,0 +1,7 @@
package test
class Foo
fun usage(foo: Foo?, action: Foo.() -> Unit) {
foo?.acti<caret>on()
}
@@ -0,0 +1,2 @@
Resolved to:
0: action: test.Foo.() -> kotlin.Unit
@@ -0,0 +1,9 @@
package test
class Foo {
val action: () -> Unit = {}
}
fun usage(foo: Foo) {
foo.acti<caret>on()
}
@@ -0,0 +1,2 @@
Resolved to:
0: (in test.Foo) val action: () -> kotlin.Unit
@@ -0,0 +1,9 @@
package test
class Foo {
val action: () -> Unit = {}
}
fun usage(foo: Foo?) {
foo?.acti<caret>on()
}
@@ -0,0 +1,2 @@
Resolved to:
0: (in test.Foo) val action: () -> kotlin.Unit