Closed
Description
Compiler version
3.3.0-RC4
3.3.1-RC1-bin-20230418-bd0858e-NIGHTLY
Minimized code
//> using scala "3.3.0-RC4"
//> using option "-Wunused:all"
object events {
final val POLLIN = 0x001
}
def withShort(v: Short): Unit = ???
def withInt(v: Int): Unit = ???
def usage() =
import events.POLLIN // reports unused
def v: Short = POLLIN
println(v)
def usage2() =
import events.POLLIN // reports unused
withShort(POLLIN)
def usage3() =
import events.POLLIN // does not report unused
withInt(POLLIN)
Output
Compiling project (Scala 3.3.0-RC4, JVM)
[warn] ./test.scala:12:17
[warn] unused import
[warn] import events.POLLIN // reports unused
[warn] ^^^^^^
[warn] ./test.scala:17:17
[warn] unused import
[warn] import events.POLLIN // reports unused
[warn] ^^^^^^
Compiled project (Scala 3.3.0-RC4, JVM)
Expectation
Should not report as unsued