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

Missing return type annotations in code examples #5773

Closed
1 task
mmcdon20 opened this issue May 6, 2024 · 0 comments · Fixed by #5774
Closed
1 task

Missing return type annotations in code examples #5773

mmcdon20 opened this issue May 6, 2024 · 0 comments · Fixed by #5774
Assignees
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.

Comments

@mmcdon20
Copy link

mmcdon20 commented May 6, 2024

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.

  • I will try and fix this problem on dart.dev.
@mmcdon20 mmcdon20 added the from.page-issue Reported in a reader-filed concern label May 6, 2024
@parlough parlough added d.enhancement Improves docs with specific ask p3-low Valid but not urgent concern. Resolve when possible. Encourage upvote to surface. e1-hours Can complete in < 8 hours of normal, not dedicated, work dev.null-safety Relates to transforming or migrating Dart code to sound null safety labels May 6, 2024
@parlough parlough self-assigned this May 6, 2024
parlough added a commit that referenced this issue May 14, 2024
These aren't necessary for the examples, but as
#5773 mentions, this helps
the samples be more consistent with the rest of the site and Effective
Dart.

Resolves #5773
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants