Skip to content
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

avoid_types_on_closure_parameters should only apply for type repeating inferred type #57756

Closed
a14n opened this issue Jul 26, 2018 · 3 comments
Closed
Assignees
Labels
analyzer-linter Issues with the analyzer's support for the linter package area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. linter-false-positive P3 A lower priority bug or feature request type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@a14n
Copy link
Contributor

a14n commented Jul 26, 2018

dynamic x;
x = (String a) => a.length; // should be OK
@dotdoom
Copy link

dotdoom commented Apr 20, 2020

One common use case is Stream#listen's onError callback with StackTrace:

  stream.listen(
      (event) => ...,
      onError: (dynamic e, StackTrace stackTrace) => ...
//                         ^^^^^^^^^^
//                         avoid_types_on_closure_parameters

@davidmorgan
Copy link
Contributor

+1, along with #58183 I think this would make it match omit_local_variable_types, which seems desirable.

@bwilkerson bwilkerson added the P3 A lower priority bug or feature request label Nov 11, 2022
@srawlins srawlins self-assigned this May 24, 2024
copybara-service bot referenced this issue May 25, 2024
Fixes https://github.com/dart-lang/linter/issues/1099
Fixes https://github.com/dart-lang/linter/issues/3330

We just add a check that the (approximate) context type is a function type.

Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: I56fe14ff8852375754fdaf6b92b3c632b7df9c95
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367982
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
@srawlins
Copy link
Member

Fixed with f07e042

@devoncarew devoncarew added analyzer-linter Issues with the analyzer's support for the linter package area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. labels Nov 18, 2024
@devoncarew devoncarew transferred this issue from dart-lang/linter Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-linter Issues with the analyzer's support for the linter package area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. linter-false-positive P3 A lower priority bug or feature request 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.

6 participants