Skip to content

join_with_return_assignment false positive on complex statements #57858

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
srawlins opened this issue Dec 27, 2018 · 0 comments
Closed

join_with_return_assignment false positive on complex statements #57858

srawlins opened this issue Dec 27, 2018 · 0 comments
Assignees
Labels
devexp-linter Issues with the analyzer's support for the linter package legacy-area-analyzer Use area-devexp instead. linter-false-positive type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@srawlins
Copy link
Member

Take the following code:

class A {
  int f;
  int g;
}

class B {
  final A a = A();
}

int main() {
  final B b1 = B();
  final B b2 = B();

  b1.a
    ..f = 1
    ..g = 1;
  b2.a.f = 2; // Error here
  return b1.a.f;
}

The join_return_with_assignment rule reports at the error comment "Join return statement with assignment when possible," because it does not see that b1.a is not equal to b2.a.

(Same cause as #57855)

@srawlins srawlins self-assigned this Dec 27, 2018
@srawlins srawlins added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) linter-false-positive labels Dec 27, 2018
@devoncarew devoncarew added devexp-linter Issues with the analyzer's support for the linter package legacy-area-analyzer Use area-devexp instead. labels Nov 18, 2024
@devoncarew devoncarew transferred this issue from dart-archive/linter Nov 18, 2024
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. linter-false-positive type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

2 participants