| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library engine.resolver; | 5 library engine.resolver; |
| 6 | 6 |
| 7 import "dart:math" as math; | 7 import "dart:math" as math; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 | 9 |
| 10 import 'package:analyzer/src/generated/utilities_collection.dart'; | 10 import 'package:analyzer/src/generated/utilities_collection.dart'; |
| (...skipping 11578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11589 * type is more specific than the current type. | 11589 * type is more specific than the current type. |
| 11590 * | 11590 * |
| 11591 * @param expression the expression used to access the static element whose ty
pes might be | 11591 * @param expression the expression used to access the static element whose ty
pes might be |
| 11592 * promoted | 11592 * promoted |
| 11593 * @param potentialType the potential type of the elements | 11593 * @param potentialType the potential type of the elements |
| 11594 */ | 11594 */ |
| 11595 void _promote(Expression expression, DartType potentialType) { | 11595 void _promote(Expression expression, DartType potentialType) { |
| 11596 VariableElement element = getPromotionStaticElement(expression); | 11596 VariableElement element = getPromotionStaticElement(expression); |
| 11597 if (element != null) { | 11597 if (element != null) { |
| 11598 // may be mutated somewhere in closure | 11598 // may be mutated somewhere in closure |
| 11599 if ((element as VariableElementImpl).isPotentiallyMutatedInClosure) { | 11599 if (element.isPotentiallyMutatedInClosure) { |
| 11600 return; | 11600 return; |
| 11601 } | 11601 } |
| 11602 // prepare current variable type | 11602 // prepare current variable type |
| 11603 DartType type = _promoteManager.getType(element); | 11603 DartType type = _promoteManager.getType(element); |
| 11604 if (type == null) { | 11604 if (type == null) { |
| 11605 type = expression.staticType; | 11605 type = expression.staticType; |
| 11606 } | 11606 } |
| 11607 // Declared type should not be "dynamic". | 11607 // Declared type should not be "dynamic". |
| 11608 if (type == null || type.isDynamic) { | 11608 if (type == null || type.isDynamic) { |
| 11609 return; | 11609 return; |
| (...skipping 3873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15483 nonFields.add(node); | 15483 nonFields.add(node); |
| 15484 return null; | 15484 return null; |
| 15485 } | 15485 } |
| 15486 | 15486 |
| 15487 @override | 15487 @override |
| 15488 Object visitNode(AstNode node) => node.accept(TypeResolverVisitor_this); | 15488 Object visitNode(AstNode node) => node.accept(TypeResolverVisitor_this); |
| 15489 | 15489 |
| 15490 @override | 15490 @override |
| 15491 Object visitWithClause(WithClause node) => null; | 15491 Object visitWithClause(WithClause node) => null; |
| 15492 } | 15492 } |
| OLD | NEW |