Skip to content

Report cascaded getters #57656

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

Open
alexeieleusis opened this issue Nov 10, 2017 · 2 comments
Open

Report cascaded getters #57656

alexeieleusis opened this issue Nov 10, 2017 · 2 comments
Labels
area-devexp For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages. devexp-linter Issues with the analyzer's support for the linter package linter-lint-request P3 A lower priority bug or feature request type-enhancement A request for a change that isn't a bug

Comments

@alexeieleusis
Copy link
Contributor

This is a request from a member of my team since it produced a bug
foo = [new Bar()..baz];
should have been
foo = [new Bar()..baz = localBaz];

@alexeieleusis alexeieleusis self-assigned this Nov 10, 2017
@pq pq added the type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) label Nov 10, 2017
@srawlins srawlins added linter-lint-request and removed type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels Jun 28, 2018
@srawlins
Copy link
Member

Interesting, so the idea is that the method call following a cascade .. should never be a getter. I like it.

@a14n
Copy link
Contributor

a14n commented Jun 28, 2018

This was detected by unnecessary_statements before dart-archive/linter#1019 because getters can have side effects. We mentioned that it could be worth to have a new lint unnecessary_getter_access or something like that (see dart-archive/linter#1014)

@pq pq added type-enhancement A request for a change that isn't a bug and removed type-enhancement A request for a change that isn't a bug labels Jun 29, 2018
@srawlins srawlins changed the title Lint cascade operations using getters Report cascaded getters Nov 23, 2022
@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
@pq pq added the P3 A lower priority bug or feature request label Nov 20, 2024
@bwilkerson bwilkerson added area-devexp For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages. and removed legacy-area-analyzer Use area-devexp instead. labels Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-devexp For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages. devexp-linter Issues with the analyzer's support for the linter package linter-lint-request P3 A lower priority bug or feature request type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

6 participants