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

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 5 years 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
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);

Powered by Google App Engine
This is Rietveld 408576698