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

Unified Diff: pkg/dev_compiler/lib/src/compiler/nullable_type_inference.dart

Issue 2551023005: Prepare for decoupling analyzer ASTs from element model. (Closed)
Patch Set: Address review comments Created 4 years 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
Index: pkg/dev_compiler/lib/src/compiler/nullable_type_inference.dart
diff --git a/pkg/dev_compiler/lib/src/compiler/nullable_type_inference.dart b/pkg/dev_compiler/lib/src/compiler/nullable_type_inference.dart
index 39f01308324edbb22a8b5d05d18574e643c087d4..39345037a4f893b90b4e543e92423f8338cb89e2 100644
--- a/pkg/dev_compiler/lib/src/compiler/nullable_type_inference.dart
+++ b/pkg/dev_compiler/lib/src/compiler/nullable_type_inference.dart
@@ -4,6 +4,7 @@
import 'dart:collection';
import 'package:analyzer/dart/ast/ast.dart';
+import 'package:analyzer/dart/ast/standard_resolution_map.dart';
import 'package:analyzer/dart/ast/token.dart' show TokenType;
import 'package:analyzer/dart/ast/visitor.dart' show RecursiveAstVisitor;
import 'package:analyzer/dart/element/element.dart';
@@ -121,7 +122,7 @@ abstract class NullableTypeInference {
return _isNullable(expr.expression, localIsNullable);
}
if (expr is InstanceCreationExpression) {
- var e = expr.staticElement;
+ var e = resolutionMap.staticElementForConstructorReference(expr);
if (e == null) return true;
// Follow redirects.
@@ -165,7 +166,7 @@ abstract class NullableTypeInference {
if (expr is MethodInvocation) {
// TODO(vsm): This logic overlaps with the resolver.
// Where is the best place to put this?
- var e = expr.methodName.staticElement;
+ var e = resolutionMap.staticElementForIdentifier(expr.methodName);
if (isInlineJS(e)) {
// Fix types for JS builtin calls.
//

Powered by Google App Engine
This is Rietveld 408576698