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

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

Issue 1531313002: fix #25280, treat setters as returning void in strong mode (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 12 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 | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | pkg/analyzer/test/generated/all_the_rest_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 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);
« no previous file with comments | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | pkg/analyzer/test/generated/all_the_rest_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698