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..c532a4256796de3fd81ce9644fdd3bc2c60e5640 100644 |
--- a/lib/src/codegen/reify_coercions.dart |
+++ b/lib/src/codegen/reify_coercions.dart |
@@ -3,14 +3,16 @@ |
// 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; |
import '../info.dart'; |
- |
+import '../utils.dart' show getStaticType; |
import 'ast_builder.dart'; |
final _log = new logger.Logger('dev_compiler.reify_coercions'); |
@@ -59,8 +61,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 +85,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); |