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

Loosen return type guidelines for local functions #6165

Merged
merged 4 commits into from
Nov 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/content/effective-dart/design.md
Original file line number Diff line number Diff line change
Expand Up @@ -1200,10 +1200,10 @@ makeGreeting(String who) {
}
```

Note that this guideline only applies to *named* function declarations:
top-level functions, methods, and local functions. Anonymous function
expressions infer a return type from their body. In fact, the syntax doesn't
even allow a return type annotation.
Note that this guideline only applies to *non-local* function declarations:
top-level, static, and instance methods and getters. Local functions and
anonymous function expressions infer a return type from their body. In fact, the
anonymous function syntax doesn't even allow a return type annotation.


### DO annotate parameter types on function declarations
Expand Down
Loading