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

Unified Diff: lib/src/codegen/reify_coercions.dart

Issue 1797063002: Resolve obvious deprecation warnings on bleeding edge (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Add test Created 4 years, 9 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
« no previous file with comments | « lib/src/codegen/nullable_type_inference.dart ('k') | lib/src/codegen/side_effect_analysis.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « lib/src/codegen/nullable_type_inference.dart ('k') | lib/src/codegen/side_effect_analysis.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698