Skip to content

3.5.0-RC2 regression: false positive unused warning on given import with wildcard #20860

Closed
@SethTisue

Description

@SethTisue

I'm on vacation and don't have time to really think about this or dig deeper, but since it's a regression I thought I should report it promptly.

//> using scala 3.5.0-RC2
//> using option -Wunused:imports

def test =
  import Ordering.Implicits.{given Ordering[?]}
  summon[Ordering[Seq[Int]]]

on 3.5.0-RC2 this gives:

[warn] unused import
[warn]   import Ordering.Implicits.{given Ordering[?]}
[warn]                              ^^^^^^^^^^^^^^^^^

but the import is definitely used — the code doesn't compile without it

note that I can write import Ordering.Implicits.seqOrdering instead, which is better code anyway, the original code is admittedly peculiar (I don't remember what I might have been thinking when I wrote it)

minimized from https://github.com/SethTisue/Project-Euler/blob/main/src/test/scala/54.scala

Metadata

Metadata

Assignees

Labels

area:lintingLinting warnings enabled with -W or -Xlintitype:bugregressionThis worked in a previous version but doesn't anymore

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions