Skip to content

False positive unused warning with import alias #17460

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

Closed
lenguyenthanh opened this issue May 10, 2023 · 1 comment
Closed

False positive unused warning with import alias #17460

lenguyenthanh opened this issue May 10, 2023 · 1 comment
Assignees
Labels
area:linting Linting warnings enabled with -W or -Xlint itype:bug

Comments

@lenguyenthanh
Copy link

Compiler version

3.3.0-RC5

Minimized code

//> using scala "3.3.0-RC5"
//> using options "-Wunused:all"


case class Foo(x: Int)

val foo = Foo(1)

@main def main =
  import foo.{x as y}
  println(y)

Output

Compiling project (Scala 3.3.0-RC5, JVM)
./UnusedImport.scala:10:15
 unused import
   import foo.{x as y}
1

Expectation

It shouldn't report any warning as the import is being used.

@lenguyenthanh lenguyenthanh added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels May 10, 2023
@lenguyenthanh lenguyenthanh changed the title False positive with import alias False positive unused warning with import alias May 10, 2023
@nicolasstucki nicolasstucki 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 May 10, 2023
@KacperFKorban
Copy link
Member

Duplicate of #17315

@KacperFKorban KacperFKorban marked this as a duplicate of #17315 May 15, 2023
@KacperFKorban KacperFKorban closed this as not planned Won't fix, can't repro, duplicate, stale May 15, 2023
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
Projects
None yet
Development

No branches or pull requests

4 participants