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

Unified Diff: pkg/analyzer/lib/src/task/strong/checker.dart

Issue 2667343005: Infer Null for return type of functions with empty returns. (Closed)
Patch Set: Address comments, fix 28630, ddc expectations Created 3 years, 10 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
Index: pkg/analyzer/lib/src/task/strong/checker.dart
diff --git a/pkg/analyzer/lib/src/task/strong/checker.dart b/pkg/analyzer/lib/src/task/strong/checker.dart
index 62bb922a87177129234ce3a1ad42ede429bb5bb6..491b50a6703913089c0f861a7cca12038e01a1b4 100644
--- a/pkg/analyzer/lib/src/task/strong/checker.dart
+++ b/pkg/analyzer/lib/src/task/strong/checker.dart
@@ -53,9 +53,10 @@ DartType _elementType(Element e) {
Element _getKnownElement(Expression expression) {
if (expression is ParenthesizedExpression) {
- expression = (expression as ParenthesizedExpression).expression;
- }
- if (expression is FunctionExpression) {
+ return _getKnownElement(expression.expression);
+ } else if (expression is NamedExpression) {
Leaf 2017/02/06 18:27:15 This fixes 28630, where we were not treating named
Jennifer Messerly 2017/02/06 20:08:09 wow this bug has been here for like ever. nice fix
+ return _getKnownElement(expression.expression);
+ } else if (expression is FunctionExpression) {
return expression.element;
} else if (expression is PropertyAccess) {
return expression.propertyName.staticElement;

Powered by Google App Engine
This is Rietveld 408576698