We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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.3.1-RC1-bin-20230213-8c616bf-NIGHTLY
//> using scala "3.3.1-RC1-bin-20230213-8c616bf-NIGHTLY" //> using options "-Wunused:all" @main def hello = for { i <- 1 to 2 if true _ = println(i) } yield ()
Compiling project (Scala 3.3.1-RC1-bin-20230213-8c616bf-NIGHTLY, JVM) [warn] ./src/scala3/FileA.scala:8:5: unused local definition [warn] i <- 1 to 2 if true [warn] ^
Don't report i as unused local definition
i
The text was updated successfully, but these errors were encountered:
for
This is due to the fact that a for like
for { i <- 1.to(2) if true } yield i
will be desugared to
1.to(2).withFilter { i => true }.map { i => i }
So i in the withFilter call is unused.
withFilter
Sorry, something went wrong.
WUnused: Fix unused warnining in synthetic symbols (#17020)
424da9f
Resolves #16925 #16926
Successfully merging a pull request may close this issue.
Compiler version
3.3.1-RC1-bin-20230213-8c616bf-NIGHTLY
Minimized code
Output
Expectation
Don't report
i
as unused local definitionThe text was updated successfully, but these errors were encountered: