Skip to content

Commit

Permalink
Loosen return type guidelines for local functions (#6165)
Browse files Browse the repository at this point in the history
  • Loading branch information
natebosch authored Nov 6, 2024
1 parent 50015fd commit 19ee51e
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit 19ee51e

Please sign in to comment.