[Proposal] allow always_declare_return_types to work together with avoid_annotating_with_dynamic #60284
Labels
area-devexp
Developer experience items (DevTools, IDEs, analysis server, completions, refactorings, ...).
devexp-linter
Issues with the analyzer's support for the linter package
linter-false-negative
P2
A bug or feature request we're likely to work on
Context: I want to avoid
dynamic
in return values and in parameters / type arguments.Consider the following situation:
The first line
foo() {}
lints correctly on the missing return type. (which implies dynamic)However, the second line does not lint on
avoid_annotating_with_dynamic
for thedynamic
return type.I believe that is a bug? In my opinion it should lint. And it can even provide a quick fix to replace dynamic with
Object?
, which is what you should really be using.Maybe this is one of the reasons why avoid_annotating_with_dynamic seems to be broken?
As for enforcing no dynamic in the fourth case I can use
always_specify_types
,but maybe we should just have a new lint that disallows dynamic altogether, in all cases? (both implicit and explicit)
See also: #58988
General info
Process info
The text was updated successfully, but these errors were encountered: