Skip to content

cascade_invocations false positive when used on different class field #58944

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
karabanovbs opened this issue Dec 6, 2022 · 2 comments
Closed
Labels
devexp-linter Issues with the analyzer's support for the linter package legacy-area-analyzer Use area-devexp instead. linter-false-positive P2 A bug or feature request we're likely to work on

Comments

@karabanovbs
Copy link

Describe the issue
In example below I have cascade_invocations warning. But method was called on different object.

To Reproduce

class ClassA {
  void method() {}
}

class ClassB {
  final ClassA field;

  ClassB(this.field);
}

void main() {
  final oldClass = ClassB(ClassA());
  final newClass = ClassB(ClassA());

  oldClass.field
    ..method()
    ..method();

  // cascade_invocations warning
  newClass.field
    ..method()
    ..method();
}

Expected behavior
no warning

Additional context
cascade_invocations warning

@srawlins
Copy link
Member

srawlins commented Dec 6, 2022

This looks like a duplicate of #58662.

@bwilkerson bwilkerson added linter-false-positive P2 A bug or feature request we're likely to work on labels Dec 13, 2022
@srawlins
Copy link
Member

Duplicate of #58662

@devoncarew devoncarew added devexp-linter Issues with the analyzer's support for the linter package legacy-area-analyzer Use area-devexp instead. labels Nov 19, 2024
@devoncarew devoncarew transferred this issue from dart-archive/linter Nov 19, 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 P2 A bug or feature request we're likely to work on
Projects
None yet
Development

No branches or pull requests

4 participants