You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And none of the text in the rule can really apply to methods, unless you maybe count a method with an expression body (=> ...) as "having" an "obvious type".
The text was updated successfully, but these errors were encountered:
Or looked at the other way, maybe the method example, specifically the return type, hints that the text of the rule should be changed to include methods ("DO type annotate fields, top-level variables, enum values, functions, methods, constructors, and typedefs ...")
The "if the type isn't obvious" component does make for a tricky simple example. The value on the right could be something like importedValue or complicated.expression(with, arguments);.
I would defer to @munificent or @natebosch as to whether the rule should be changed to fit the examples.
antfitch
changed the title
Effective Dart "DO type annotate fields and top-level variables ..." example uses a method
Effective Dart "DO type annotate fields ..." bad example
Mar 5, 2025
antfitch
changed the title
Effective Dart "DO type annotate fields ..." bad example
DO type annotate fields ... bad example
Mar 5, 2025
The bad example, and the first example, under "DO type annotate fields and top-level variables if the type isn't obvious
" use a method, and don't contain a field or top-level variable anywhere.
And none of the text in the rule can really apply to methods, unless you maybe count a method with an expression body (
=> ...
) as "having" an "obvious type".The text was updated successfully, but these errors were encountered: