Missing return type annotations in code examples #5773
Labels
d.enhancement
Improves docs with specific ask
dev.null-safety
Relates to transforming or migrating Dart code to sound null safety
e1-hours
Can complete in < 8 hours of normal, not dedicated, work
from.page-issue
Reported in a reader-filed concern
p3-low
Valid but not urgent concern. Resolve when possible. Encourage upvote to surface.
Page URL
https://dart.dev/null-safety/understanding-null-safety
Page source
https://github.com/dart-lang/site-www/tree/main/src/content/null-safety/understanding-null-safety.md
Describe the problem
This is really a minor nitpick, but I noticed that in the "understanding null safety" article there are multiple code examples that involve function definitions without return type annotations.
This seems inconsistent because this goes against the advice in effective dart (https://dart.dev/effective-dart/design#do-annotate-return-types-on-function-declarations), and other articles seem to annotate the return types unless trying to illustrate a specific point about omitting the types (for example https://dart.dev/language/functions).
Expected fix
Annotate the return types in the code examples.
Additional context
No response
I would like to fix this problem.
The text was updated successfully, but these errors were encountered: