KTIJ-26103 [Analysis API] Ignore implicit dispatch receivers in Reference Shortener

Calls to extension functions imported from objects have implicit
dispatch receivers, but those receivers are not present in the code
and should not be analyzed by the shortener

^KTIJ-26103 Fixed
This commit is contained in:
Roman Golyshev
2023-07-03 15:57:49 +02:00
committed by teamcity
parent 8d2ac41454
commit c5ded1ba48
7 changed files with 57 additions and 2 deletions
@@ -0,0 +1,15 @@
// FILE: main.kt
package test
import dependency.Bar.extFun
fun usage(str: String) {
<expr>str.extFun()</expr>
}
// FILE: dependency.kt
package dependency
object Bar {
fun String.extFun() {}
}
@@ -0,0 +1,5 @@
Before shortening: str.extFun()
with DO_NOT_SHORTEN:
with SHORTEN_IF_ALREADY_IMPORTED:
with SHORTEN_AND_IMPORT:
with SHORTEN_AND_STAR_IMPORT: