Skip to content

-Ywarn-unused:patvars false positive #12000

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
oscar-broman opened this issue May 15, 2020 · 2 comments
Closed

-Ywarn-unused:patvars false positive #12000

oscar-broman opened this issue May 15, 2020 · 2 comments

Comments

@oscar-broman
Copy link

reproduction steps

Scala 2.13.2

scala -Ywarn-unused:patvars
scala> for (k @ (a, _) <- Option((0, 0)) if a == 0) yield k

warning: pattern var k in value $anonfun is never used: use a wildcard `_` or suppress this warning with `k@_`

problem

k is used and the code won't compile without it. The warning appears to happen due to withFilter not using k.

@SethTisue SethTisue added this to the Backlog milestone May 15, 2020
@SethTisue
Copy link
Member

looks like one that @som-snytt will want to 👀

@som-snytt
Copy link

Duplicates #11400
Duplicates #10287

@SethTisue SethTisue removed this from the Backlog milestone May 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants