Skip to content

False positive for unnecessary_lambdas #57957

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
davidmorgan opened this issue May 9, 2019 · 0 comments · Fixed by dart-archive/linter#2132
Closed

False positive for unnecessary_lambdas #57957

davidmorgan opened this issue May 9, 2019 · 0 comments · Fixed by dart-archive/linter#2132
Assignees
Labels
customer-google3 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

@davidmorgan
Copy link
Contributor

davidmorgan commented May 9, 2019

  int count(String s) => s.length;
  final strings = ['a', 'bb', 'ccc', 'dddd'];
  final map = Map<String, int>.fromIterable(strings, value: (s) => count(s)); // lint fires here

...apply suggestion...

final map = Map<String, int>.fromIterable(strings, value: count);

error: The function 'count' has type '(String) → int' that isn't of expected type '(dynamic) → int'. This means its parameter or return type does not match what is expected.

@pq pq added linter-false-positive type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels May 16, 2019
@pq pq self-assigned this May 10, 2020
@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
customer-google3 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

Successfully merging a pull request may close this issue.

3 participants