Chromium Code Reviews| Index: lib/src/codegen/reify_coercions.dart |
| diff --git a/lib/src/codegen/reify_coercions.dart b/lib/src/codegen/reify_coercions.dart |
| index 70c1d3e2d7657293fed0f8ed40cdb7b2ea080c20..1a3c20a54bd2aa1505b7337a198da39e7adf9fa9 100644 |
| --- a/lib/src/codegen/reify_coercions.dart |
| +++ b/lib/src/codegen/reify_coercions.dart |
| @@ -3,8 +3,10 @@ |
| // BSD-style license that can be found in the LICENSE file. |
| import 'package:analyzer/analyzer.dart' as analyzer; |
| -import 'package:analyzer/src/generated/ast.dart'; |
| -import 'package:analyzer/src/generated/element.dart'; |
| +import 'package:analyzer/dart/ast/ast.dart'; |
| +import 'package:analyzer/dart/element/element.dart'; |
| +import 'package:analyzer/dart/element/type.dart'; |
| +import 'package:analyzer/src/dart/ast/utilities.dart' show NodeReplacer; |
| import 'package:analyzer/src/generated/type_system.dart' |
| show StrongTypeSystemImpl; |
| import 'package:logging/logging.dart' as logger; |
| @@ -12,6 +14,7 @@ import 'package:logging/logging.dart' as logger; |
| import '../info.dart'; |
| import 'ast_builder.dart'; |
| +import '../utils.dart' show getStaticType; |
|
Jennifer Messerly
2016/03/14 23:12:42
not sure if we want to try keeping this sorted (is
Leaf
2016/03/14 23:58:42
Done.
|
| final _log = new logger.Logger('dev_compiler.reify_coercions'); |
| @@ -59,8 +62,8 @@ class CoercionReifier extends analyzer.GeneralizingAstVisitor<Object> { |
| Object _visitInferredTypeBase(InferredTypeBase node, Expression expr) { |
| DartType t = node.type; |
| - if (!_typeSystem.isSubtypeOf(_getStaticType(expr), t)) { |
| - if (_getStaticType(expr).isDynamic) { |
| + if (!_typeSystem.isSubtypeOf(getStaticType(expr), t)) { |
| + if (getStaticType(expr).isDynamic) { |
| var cast = Coercion.cast(expr.staticType, t); |
| var info = new DynamicCast(_typeSystem, expr, cast); |
| CoercionInfo.set(expr, info); |
| @@ -83,10 +86,6 @@ class CoercionReifier extends analyzer.GeneralizingAstVisitor<Object> { |
| return null; |
| } |
| - DartType _getStaticType(Expression expr) { |
| - return expr.staticType ?? DynamicTypeImpl.instance; |
| - } |
| - |
| /// Coerce [e] using [c], returning a new expression. |
| Expression coerceExpression(Expression e, Coercion c) { |
| assert(c != null); |