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 bffeaadc6ec92b39364d1d1b2ca2a507b2efb889..3da6e37dde38cd8be063f5e9ba6bffabd0fef6c4 100644 |
--- a/pkg/analyzer/lib/src/generated/static_type_analyzer.dart |
+++ b/pkg/analyzer/lib/src/generated/static_type_analyzer.dart |
@@ -328,7 +328,9 @@ class StaticTypeAnalyzer extends SimpleAstVisitor<Object> { |
node.element as ExecutableElementImpl; |
functionElement.returnType = |
_computeStaticReturnTypeOfFunctionDeclaration(node); |
- _recordPropagatedTypeOfFunction(functionElement, function.body); |
+ if (node.parent is FunctionDeclarationStatement) { |
+ _recordPropagatedTypeOfFunction(functionElement, function.body); |
+ } |
_recordStaticType(function, functionElement.type); |
return null; |
} |