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

[warning] UNUSED_LOCAL_VARIABLE false negative #59582

Open
stephane-archer opened this issue Nov 21, 2024 · 2 comments
Open

[warning] UNUSED_LOCAL_VARIABLE false negative #59582

stephane-archer opened this issue Nov 21, 2024 · 2 comments
Labels
analyzer-warning Issues with the analyzer's Warning codes area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P3 A lower priority bug or feature request type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@stephane-archer
Copy link

stephane-archer commented Nov 21, 2024

void foo() {
          var i = 0;
          i = i + 1;
}

there is no warning but it should indicate The value of the local variable 'i' isn't used. Try removing the variable or using it.
because it's used to update itself and i is not used elsewhere

while withi += 1; it act correctly

@stephane-archer stephane-archer added the area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. label Nov 21, 2024
@lrhn lrhn added the type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) label Nov 21, 2024
@pq pq added the analyzer-warning Issues with the analyzer's Warning codes label Nov 21, 2024
@pq pq changed the title [Linter Update] The value of the local variable 'i' isn't used. Try removing the variable or using it. [warning] UNUSED_LOCAL_VARIABLE false negative Nov 21, 2024
@pq pq added the P3 A lower priority bug or feature request label Nov 21, 2024
@pq
Copy link
Member

pq commented Nov 21, 2024

Thanks!

(I changed the title a bit to reflect that this is about the UNUSED_LOCAL_VARIABLE warning.)

@stephane-archer
Copy link
Author

Thanks for helping me making a good issue :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-warning Issues with the analyzer's Warning codes area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P3 A lower priority bug or feature request type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

3 participants