Closed
Description
Compiler version
- 3.6.0-RC1-bin-20240828-5e83606-NIGHTLY
- 3.5.1-RC2
- 3.5.0
- 3.4.3
- 3.3.3
Minimized example
build.sbt
scalaVersion := "3.5.1-RC2"
scalacOptions += "-Wunused:imports"
A.scala
import scala.reflect.TypeTest
trait A {
type B
type C <: B
given instance: TypeTest[B, C]
}
def f(a: A, b: a.B): Boolean = {
import a.C
b match {
case _: C =>
true
case _ =>
false
}
}
Output Error/Warning message
[warn] -- [E198] Unused Symbol Warning: false-unused-import-warn-example-project/A.scala:11:11
[warn] 11 | import a.C
[warn] | ^
[warn] | unused import
Why this Error/Warning was not helpful
a.C
is not unused
Suggested improvement
don't warn