Skip to content

invariant_booleans false positive with unary operations. #57399

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
dikmax opened this issue Nov 20, 2016 · 2 comments
Closed

invariant_booleans false positive with unary operations. #57399

dikmax opened this issue Nov 20, 2016 · 2 comments
Assignees
Labels
devexp-linter Issues with the analyzer's support for the linter package legacy-area-analyzer Use area-devexp instead.

Comments

@dikmax
Copy link

dikmax commented Nov 20, 2016

Consider this code:

if (offset >= length) {
  return;
}

offset++;
if (offset >= length) { // Got error here.
}

With += works fine.

Linter 0.1.29

@alexeieleusis alexeieleusis self-assigned this Nov 21, 2016
@dikmax
Copy link
Author

dikmax commented Nov 22, 2016

As mentioned #57396, I can be sure that it reproducible in 0.1.27 (version bundled with Dart 1.20.1), not in 0.1.29.

@alexeieleusis
Copy link
Contributor

This is indeed a bug, those operators were not considered when looking for mutations, this rule needs some cleanup, I will fix this bug after that. It will take a while, but will be fixed.

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.
Projects
None yet
Development

No branches or pull requests

3 participants