Closed
Description
Compiler version
3.3.0-RC3
Minimized code
https://scastie.scala-lang.org/mrdziuban/e4rXAgetT5aGQLL1zt4BJw/9
package example {
object test1 {
val test = "test"
}
object test2 {
import example.test1 as t1
val test = t1.test
}
}
Output
import example.test1 as t1
^^^^^^^^^^^
unused import
Expectation
The import should not be reported unused since the rest of the code in object test2
fails to compile without it. This seems to only happen when the renamed import comes from the same package as the code where it's imported.