Skip to content

Add the linter option -Wunused:patvars #16628

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
PaulCoral opened this issue Jan 6, 2023 · 1 comment
Closed

Add the linter option -Wunused:patvars #16628

PaulCoral opened this issue Jan 6, 2023 · 1 comment
Assignees
Labels
area:linting Linting warnings enabled with -W or -Xlint area:reporting Error reporting including formatting, implicit suggestions, etc itype:enhancement

Comments

@PaulCoral
Copy link
Contributor

PaulCoral commented Jan 6, 2023

In the (currently approved) PR #16157 (related to issue #15503), which add some linter options, it was decided not to add -Wunused:patvars yet, as it requires modifications to more phases of the compiler. Thus, it seems a better idea to handle it separately.

The current replacement is -Wunused:unsafe-warn-patvars which doesn't support suppressing warnings (x @ _), thus triggering false positive, i.e. in for expression.

The issue is that it seems not possible to differentiate these cases, after desugaring :

case Foo(x)   => ??? // desugared to Foo(x@_)
case Foo(x@_) => ???

TODO :

  • Add -Wunused:patvars (which should also be triggered by -Wunused:all)
  • remove -Wunused:unsafe-warn-patvars
  • Update the test suits i15503*.scala
  • Update the help message.
@PaulCoral PaulCoral changed the title Add the linter options -Wunused:patvars Add the linter option -Wunused:patvars Jan 6, 2023
@prolativ prolativ added itype:enhancement area:reporting Error reporting including formatting, implicit suggestions, etc labels Jan 9, 2023
@jchyb jchyb added the area:linting Linting warnings enabled with -W or -Xlint label Feb 12, 2023
@Gedochao Gedochao assigned Linyxus and unassigned aherlihy May 10, 2024
@Linyxus Linyxus closed this as not planned Won't fix, can't repro, duplicate, stale Jul 9, 2024
@Linyxus
Copy link
Contributor

Linyxus commented Jul 9, 2024

After discussing this issue on today's LAMP compiler meeting, we decide to close it as not planned.

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 area:reporting Error reporting including formatting, implicit suggestions, etc itype:enhancement
Projects
None yet
Development

No branches or pull requests

5 participants