| Index: pkg/analyzer/lib/src/generated/static_type_analyzer.dart
|
| diff --git a/pkg/analyzer/lib/src/generated/static_type_analyzer.dart b/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
|
| index 106ff7a72ab22d64c6f9e751b95558ad7414b8e3..ba8aa8cf73d5d7ed4f6a3eff94fd0f86cf9c7b92 100644
|
| --- a/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
|
| +++ b/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
|
| @@ -413,9 +413,11 @@ class StaticTypeAnalyzer extends SimpleAstVisitor<Object> {
|
| FunctionExpression function = node.functionExpression;
|
| ExecutableElementImpl functionElement =
|
| node.element as ExecutableElementImpl;
|
| - functionElement.returnType =
|
| - _computeStaticReturnTypeOfFunctionDeclaration(node);
|
| if (node.parent is FunctionDeclarationStatement) {
|
| + // TypeResolverVisitor sets the return type for top-level functions, so
|
| + // we only need to handle local functions.
|
| + functionElement.returnType =
|
| + _computeStaticReturnTypeOfFunctionDeclaration(node);
|
| _recordPropagatedTypeOfFunction(functionElement, function.body);
|
| }
|
| _recordStaticType(function, functionElement.type);
|
|
|