Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(361)

Unified Diff: pkg/analyzer/lib/src/generated/static_type_analyzer.dart

Issue 1309243007: Stop propagating return types for top-level function declarations (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Added test of function expression propagation Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/incremental_resolver_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/incremental_resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698