Skip to content

[Wildcard Variables] support for prefer_final_parameters #59495

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
Tracked by #59471
pq opened this issue Aug 5, 2024 · 1 comment
Closed
Tracked by #59471

[Wildcard Variables] support for prefer_final_parameters #59495

pq opened this issue Aug 5, 2024 · 1 comment
Assignees
Labels
devexp-linter Issues with the analyzer's support for the linter package legacy-area-analyzer Use area-devexp instead. linter-false-positive linter-new-language-feature P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug

Comments

@pq
Copy link
Member

pq commented Aug 5, 2024

The rule docs state:

Declaring parameters as final when possible is a good practice because it helps avoid accidental reassignments.

Wildcard params can't be accidentally assigned to so there's no need to make them final. (Users still can mark them final if they feel that's better documentation but that's outside this lint.)

@pq pq added type-enhancement A request for a change that isn't a bug linter-false-positive P2 A bug or feature request we're likely to work on linter-new-language-feature labels Aug 5, 2024
@pq pq self-assigned this Aug 5, 2024
copybara-service bot referenced this issue Aug 6, 2024
Fixes: https://github.com/dart-lang/linter/issues/5044

Change-Id: Ibbf24df34133cfa75deed357733c2ae0637251f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/378902
Reviewed-by: Brian Wilkerson <[email protected]>
Commit-Queue: Phil Quitslund <[email protected]>
@pq
Copy link
Member Author

pq commented Aug 6, 2024

Implemented w/ 2fe6ffe.

@pq pq closed this as completed Aug 6, 2024
@devoncarew devoncarew added devexp-linter Issues with the analyzer's support for the linter package legacy-area-analyzer Use area-devexp instead. labels Nov 20, 2024
@devoncarew devoncarew transferred this issue from dart-archive/linter Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devexp-linter Issues with the analyzer's support for the linter package legacy-area-analyzer Use area-devexp instead. linter-false-positive linter-new-language-feature P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

2 participants