[Analysis API] Unwrap anonymous function expressions in reference shortener

Anonymous functions are additionally wrapped into an expression

^KTIJ-26629 Fixed
^KTIJ-26597 Fixed
This commit is contained in:
Roman Golyshev
2023-08-14 12:55:40 +02:00
committed by teamcity
parent bddc18e463
commit 48433bf9fd
9 changed files with 104 additions and 5 deletions
@@ -0,0 +1,9 @@
// FILE: main.kt
package test
val anonymous = <expr>@dependency.Ann</expr> fun() {}
// FILE: dependency.kt
package dependency
annotation class Ann
@@ -0,0 +1,7 @@
Before shortening: @dependency.Ann
with DO_NOT_SHORTEN:
with SHORTEN_IF_ALREADY_IMPORTED:
with SHORTEN_AND_IMPORT:
[type] dependency.Ann
with SHORTEN_AND_STAR_IMPORT:
[type] dependency.Ann
@@ -0,0 +1,9 @@
// FILE: main.kt
package test
val anonymous = fun <expr>dependency.Type</expr>.() {}
// FILE: dependency.kt
package dependency
class Type
@@ -0,0 +1,7 @@
Before shortening: dependency.Type
with DO_NOT_SHORTEN:
with SHORTEN_IF_ALREADY_IMPORTED:
with SHORTEN_AND_IMPORT:
[type] dependency.Type
with SHORTEN_AND_STAR_IMPORT:
[type] dependency.Type
@@ -0,0 +1,9 @@
// FILE: main.kt
package test
val anonymous = fun(): <expr>dependency.Type</expr> = dependency.Type()
// FILE: dependency.kt
package dependency
class Type
@@ -0,0 +1,7 @@
Before shortening: dependency.Type
with DO_NOT_SHORTEN:
with SHORTEN_IF_ALREADY_IMPORTED:
with SHORTEN_AND_IMPORT:
[type] dependency.Type
with SHORTEN_AND_STAR_IMPORT:
[type] dependency.Type