Skip to content

-Wunused:imports false positive when import is used in a type argument #16680

Closed
@cb372

Description

@cb372

Compiler version

3.3.0-RC1-bin-20230112-be10bc6-NIGHTLY

Minimized code

//> using scala "3.3.0-RC1-bin-20230112-be10bc6-NIGHTLY"
//> using option "-Wunused:imports"

package foo:
  class IO[A]

package bar:
  import foo.IO

  def f[F[_]]: String = "hello"
  def go = f[IO]

Output

$ scala-cli compile unused-import.scala
[warn] ./unused-import.scala:8:14: unused import
[warn]   import foo.IO
[warn]              ^^

Expectation

No warning

Metadata

Metadata

Assignees

Labels

area:reportingError reporting including formatting, implicit suggestions, etcitype:bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions