-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
area:lintingLinting warnings enabled with -W or -XlintLinting warnings enabled with -W or -Xlintitype:bug
Milestone
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
Metadata
Metadata
Assignees
Labels
area:lintingLinting warnings enabled with -W or -XlintLinting warnings enabled with -W or -Xlintitype:bug