From 19ee51e4e3942b077300b23d8ba8523d044c04f1 Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Wed, 6 Nov 2024 03:00:18 -0800 Subject: [PATCH] Loosen return type guidelines for local functions (#6165) --- src/content/effective-dart/design.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/content/effective-dart/design.md b/src/content/effective-dart/design.md index 47f6c6ca31..cf5e3d5b94 100644 --- a/src/content/effective-dart/design.md +++ b/src/content/effective-dart/design.md @@ -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