Skip to content

False positive unused warning #24665

@drewfeelsblue

Description

@drewfeelsblue

Minimized code

//> using options -Wunused:all

def method[A](f: [g[_]] => Unit => g[A]) = ()

@main def main = method([g[_]] => (_: Unit) => null.asInstanceOf[g[Int]])

Output

scala-cli compile --scala 3.7.0 poly.scala
Compiling project (Scala 3.7.0, JVM (21))
Compiled project (Scala 3.7.0, JVM (21))

vs.

scala-cli compile --scala 3.3.7 poly.scala
[warn] ./poly.scala:5:26
[warn] unused private member
[warn] @main def main = method([g[_]] => (_: Unit) => null.asInstanceOf[g[Int]])
[warn]

Expectation

no warnings

Metadata

Metadata

Assignees

Labels

area:lintingLinting warnings enabled with -W or -Xlintitype:bugstat:fixed in nextThe issue was fixed in Next and only still applies to LTS.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions