[Analysis API FIR] do not consider unresolved imports as unused in import optimizer

Otherwise, the import optimizer breaks incomplete code

^KTIJ-25034 fixed
This commit is contained in:
Ilya Kirillov
2023-03-24 10:06:09 +01:00
committed by Space Team
parent d9ca77f716
commit 15f19f324e
21 changed files with 236 additions and 5 deletions
@@ -0,0 +1,7 @@
package m2.second
import a.b.c.readText
fun t() {
readText()
}
@@ -0,0 +1,7 @@
package m2.second
import a.b.c.*
fun t() {
readText()
}
@@ -0,0 +1,7 @@
package m2.second
import a.b.c.prop
fun t() {
prop
}
@@ -0,0 +1,7 @@
package m2.second
import a.b.c.X
fun t(): X {
}
@@ -0,0 +1,7 @@
package m2.second
import a.b.c.X
fun t(): List<X> {
}
@@ -0,0 +1,8 @@
package m2.second
import a.b.c.X
import a.b.c.C
fun t() {
X.C
}
@@ -0,0 +1,8 @@
package m2.second
import a.b.c.X
import a.b.c.C
fun t() {
X.C()
}
@@ -0,0 +1,7 @@
package m2.second
import a.b.c.prop as prp
fun t() {
prp
}
@@ -0,0 +1,9 @@
package one
import a.c.c.D
import a.a.Foo
import a.star.*
fun t() {
D()
}