-
Notifications
You must be signed in to change notification settings - Fork 21
Unused warning occurred even if the variable was used #11175
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
Comments
/cc @som-snytt |
Thanks, I'm already taking a look, sigh. Someone brought up another issue, not sure if it's a ticket, but my response was that the current approach will remain brittle, short of a rewrite. |
It snags the filtering expression:
The related umbrella issue #10287 is still open. |
Ok, I'm rescheduling for 2.13.x, since we shouldn't be rewriting things in 2.12 anymore, and it sounds like that's what's required for a robust fix. |
Hi In which release this issue has been or is planned to be resolved? regards |
@manuchadha1979 this is currently targeting the 2.13.1 milestone, but it looks like no one has picked up fixing it yet. |
Thanks. Would the current work around be either not to use the compiler option or not to use use the |
It's your choice. An alternative to not using the compiler option or not using the for comprehension is this: object Hello {
for {
a <- Option(1)
b <- Option(2) if a == 1
+ useB = b // WORKAROUND scala/bug#11175 -Ywarn-unused:params false positive
} yield a + b
} |
Modulo side-effects:
|
I used a
|
Apologies to the 22 thumbs-up voters, who probably meant thumbs-down. The technology was pushed to its limit. Is it a coincidence that it topped out at 22, or does github use a Tuple? |
consolidating at #10287 |
Given the following code:
Compiling with
-Ywarn-unused:params
on 2.12.7 gives the following warning:However, no warning occurred on 2.12.6.
The text was updated successfully, but these errors were encountered: