Chromium Code Reviews| 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..464ff0ebe999f660cb4b29dba9799144025658d7 100644 |
| --- a/pkg/analyzer/lib/src/generated/static_type_analyzer.dart |
| +++ b/pkg/analyzer/lib/src/generated/static_type_analyzer.dart |
| @@ -413,9 +413,10 @@ 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 will have set this for top-level functions. |
|
Brian Wilkerson
2015/12/17 17:57:59
"this" --> "the return type"
Jennifer Messerly
2016/01/05 00:42:44
Done & added a bit more clarity as well.
|
| + functionElement.returnType = |
| + _computeStaticReturnTypeOfFunctionDeclaration(node); |
| _recordPropagatedTypeOfFunction(functionElement, function.body); |
| } |
| _recordStaticType(function, functionElement.type); |