Skip to content

parameter_assignments false positive #61169

@FMorschel

Description

@FMorschel

Repro:

void pattern(bool value) {
  value = true; // parameter_assignments 
  if (!value || value) {}
  //   ^  parameter_assignments
}

The !value triggers parameter_assignments here, and it shouldn't.

Really not sure what it was trying to do there. At least it only triggers if we have a real case for it. It also happens if you exchange the operands (but we get a dead code warning and that is not a case I wanted to use as a repro) so it is not the ordering, it has something to do with !.

FYI @bwilkerson

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2A bug or feature request we're likely to work onarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-linterIssues with the analyzer's support for the linter packagelinter-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