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 084b65de3fc5ede09fe750d3c5687810331a48ae..ff88128b907fa5ce74f163dc6047eac65a790e32 100644 |
| --- a/pkg/analyzer/lib/src/generated/static_type_analyzer.dart |
| +++ b/pkg/analyzer/lib/src/generated/static_type_analyzer.dart |
| @@ -1171,7 +1171,12 @@ class StaticTypeAnalyzer extends SimpleAstVisitor<Object> { |
| } |
| if (propagatedType != null && |
| propagatedType.isMoreSpecificThan(staticType)) { |
| + // TODO(scheglov) "isMoreSpecificThan" returns "true" when |
| + // "propagatedType" is the same as "staticType". |
| + // Not sure if it is useful to record. |
|
Brian Wilkerson
2014/12/19 15:03:29
I thought that we were not recording a propagated
|
| _recordPropagatedType(node, propagatedType); |
| + } else { |
| + node.propagatedType = null; |
| } |
| return null; |
| } |
| @@ -1660,6 +1665,8 @@ class StaticTypeAnalyzer extends SimpleAstVisitor<Object> { |
| void _recordPropagatedType(Expression expression, DartType type) { |
| if (type != null && !type.isDynamic && !type.isBottom) { |
| expression.propagatedType = type; |
| + } else { |
| + expression.propagatedType = null; |
| } |
| } |