KTIJ-26627 [AA] Correctly handle object receivers of property accesses

Also remove redundant code from `canBePossibleToDropReceiver`

^KTIJ-26627 Fixed
This commit is contained in:
Roman Golyshev
2023-08-13 20:21:44 +02:00
parent 2db8f31966
commit b52d3c114f
7 changed files with 63 additions and 11 deletions
@@ -0,0 +1,11 @@
package test
fun <T> T.extFun(): T = this
object Bar
class Other
fun Other.usage() {
<expr>Bar.extFun()</expr>
}
@@ -0,0 +1,5 @@
Before shortening: Bar.extFun()
with DO_NOT_SHORTEN:
with SHORTEN_IF_ALREADY_IMPORTED:
with SHORTEN_AND_IMPORT:
with SHORTEN_AND_STAR_IMPORT:
@@ -0,0 +1,12 @@
package test
val <T> T.extProperty: T
get() = this
object Bar
class Other
fun Other.usage() {
<expr>Bar.extProperty</expr>
}
@@ -0,0 +1,5 @@
Before shortening: Bar.extProperty
with DO_NOT_SHORTEN:
with SHORTEN_IF_ALREADY_IMPORTED:
with SHORTEN_AND_IMPORT:
with SHORTEN_AND_STAR_IMPORT: