Skip to content
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

prefer_final_locals false positive in for-loop destructured records #4539

Closed
pq opened this issue Jul 6, 2023 · 0 comments · Fixed by #4540
Closed

prefer_final_locals false positive in for-loop destructured records #4539

pq opened this issue Jul 6, 2023 · 0 comments · Fixed by #4540
Assignees
Labels
false-positive set-internal-available Affects a rule that is allowed internally (but not generally required or recommended). type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@pq
Copy link
Member

pq commented Jul 6, 2023

See: dart-lang/sdk#52820

TL;DR: the lint should only fire if all declared variables can be changed to final

Repro:

f() {
  for (var (a, b) in [(1, 2)]) {
    ++a;
  }
}

(Should not flag b.)

@pq pq added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) false-positive labels Jul 6, 2023
@pq pq self-assigned this Jul 6, 2023
@pq pq added the set-internal-available Affects a rule that is allowed internally (but not generally required or recommended). label Jul 6, 2023
@pq pq closed this as completed in #4540 Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
false-positive set-internal-available Affects a rule that is allowed internally (but not generally required or recommended). type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant