KT-60957 [Analysis API] Properly handle source PSI for implicit invoke calls in KtFirReferenceShortener
For implicit invoke operator calls, there are two instances of `FirResolvedNamedReference`. One of them references `invoke` function and cannot be used to analyze the property access, and the second one has `source == null`. Luckily, the parent of the second reference is `FirPropertyAccessExpression`, which has the correct source ^KT-60957 Fixed
This commit is contained in:
+15
@@ -0,0 +1,15 @@
|
||||
// FILE: main.kt
|
||||
package test
|
||||
|
||||
fun usage() {
|
||||
<expr>dependency.foo()</expr>
|
||||
}
|
||||
|
||||
// FILE: dependency.kt
|
||||
package dependency
|
||||
|
||||
var foo: Foo = Foo()
|
||||
|
||||
class Foo {
|
||||
operator fun invoke() {}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
Before shortening: dependency.foo()
|
||||
with DO_NOT_SHORTEN:
|
||||
with SHORTEN_IF_ALREADY_IMPORTED:
|
||||
with SHORTEN_AND_IMPORT:
|
||||
[qualifier] dependency.foo()
|
||||
with SHORTEN_AND_STAR_IMPORT:
|
||||
[qualifier] dependency.foo()
|
||||
Reference in New Issue
Block a user