Skip to content

proposal: list_remove_unrelated_type and iterable_contains_unrelated_type #58876

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
5 tasks
srawlins opened this issue Sep 19, 2022 · 0 comments · Fixed by dart-archive/linter#3695
Closed
5 tasks
Labels
devexp-linter Issues with the analyzer's support for the linter package legacy-area-analyzer Use area-devexp instead. linter-false-negative linter-lint-proposal linter-set-core linter-status-pending type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@srawlins
Copy link
Member

list_remove_unrelated_type and iterable_contains_unrelated_type

Description

Provide a short description suitable for display in console output.

I don't understand what this means.

Details

The list_remove_unrelated_type and iterable_contains_unrelated_type rules don't report method calls with implicit receivers declared in enums.

Kind

Does this enforce style advice? Guard against errors? Other?

I feel like I've fallen into the wrong template.

Good Examples

enum E implements List<int> {
  one,
  two;

  @override
  dynamic noSuchMethod(_) => throw UnsupportedError('');

  void f() {
    contains(1); // OK
  }
}

Bad Examples

enum E implements List<int> {
  one,
  two;

  @override
  dynamic noSuchMethod(_) => throw UnsupportedError('');

  void f() {
    contains('string'); // LINT
  }
}

Discussion

Discussion checklist

  • List any existing rules this proposal modifies, complements, overlaps or conflicts with.
  • List any relevant issues (reported here, the SDK Tracker, or elsewhere).
  • If there's any prior art (e.g., in other linters), please add references here.
  • If this proposal corresponds to Effective Dart or Flutter Style Guide advice, please call it out. (If there isn’t any corresponding advice, should there be?)
  • If this proposal is motivated by real-world examples, please provide as many details as you can. Demonstrating potential impact is especially valuable.
@srawlins srawlins added the type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) label Sep 19, 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 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-negative linter-lint-proposal linter-set-core linter-status-pending type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants