Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
SethTisue opened this issue Jun 28, 2024 · 1 comment · Fixed by #20989
Closed
Assignees
Labels
area:linting Linting warnings enabled with -W or -Xlint itype:bug regression This worked in a previous version but doesn't anymore

Comments

@SethTisue
Copy link
Member

SethTisue commented Jun 28, 2024

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

@SethTisue SethTisue added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Jun 28, 2024
@som-snytt
Copy link
Contributor

som-snytt commented Jun 28, 2024

warns with 975df4a

of the refactor #20321

(I was going to follow up for some ticket but haven't looked yet.)

Edit: maybe the refactor tightened some screws; the PR just tweaks by half a turn.

@som-snytt som-snytt added area:linting Linting warnings enabled with -W or -Xlint and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Jun 28, 2024
@Gedochao Gedochao added the regression This worked in a previous version but doesn't anymore label Jul 3, 2024
@sjrd sjrd closed this as completed in fa58f93 Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:linting Linting warnings enabled with -W or -Xlint itype:bug regression This worked in a previous version but doesn't anymore
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants