Skip to content

invariant_booleans: false positive on comparisons #57734

Closed
@pschiffmann

Description

@pschiffmann

invariant_booleans reports the else if condition of the following code:

void f(int a, int b) {
  if (a < b) {
  } else if (b < a) {}
}

whereas this is correctly not reported:

void f(int a, int b) {
  if (a < b) {
  } else if (a > b) {}
}

I'm using the linter that is bundled with Dart 2.0.0-dev.66.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    devexp-linterIssues with the analyzer's support for the linter packagelegacy-area-analyzerUse area-devexp instead.linter-false-positiveIssues related to lint rules that report a problem when it isn't a problem.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions