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

Unified Diff: pkg/compiler/lib/src/inferrer/inferrer_visitor.dart

Issue 2603263002: Prefix resolution_types with Resolution. (Closed)
Patch Set: Rebased Created 3 years, 11 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 | « pkg/compiler/lib/src/enqueue.dart ('k') | pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/inferrer/inferrer_visitor.dart
diff --git a/pkg/compiler/lib/src/inferrer/inferrer_visitor.dart b/pkg/compiler/lib/src/inferrer/inferrer_visitor.dart
index 9a8e807feaf044fab5862434ee7f5cb6b7377f4d..20ae0defa9d5c7c15eedf30ec91abe18ca0aa57d 100644
--- a/pkg/compiler/lib/src/inferrer/inferrer_visitor.dart
+++ b/pkg/compiler/lib/src/inferrer/inferrer_visitor.dart
@@ -79,7 +79,7 @@ abstract class TypeSystem<T> {
* [isNullable] indicates whether the annotation implies a null
* type.
*/
- T narrowType(T type, DartType annotation, {bool isNullable: true});
+ T narrowType(T type, ResolutionDartType annotation, {bool isNullable: true});
/**
* Returns the non-nullable type [T].
@@ -1009,7 +1009,7 @@ abstract class InferrerVisitor<T, E extends MinimalInferrerEngine<T>>
}
void updateIsChecks(List<Node> tests, {bool usePositive}) {
- void narrow(Element element, DartType type, Node node) {
+ void narrow(Element element, ResolutionDartType type, Node node) {
if (element is LocalElement) {
T existing = locals.use(element);
T newType = types.narrowType(existing, type, isNullable: false);
@@ -1025,7 +1025,8 @@ abstract class InferrerVisitor<T, E extends MinimalInferrerEngine<T>>
} else {
if (!usePositive) continue;
}
- DartType type = elements.getType(node.typeAnnotationFromIsCheckOrCast);
+ ResolutionDartType type =
+ elements.getType(node.typeAnnotationFromIsCheckOrCast);
narrow(elements[node.receiver], type, node);
} else {
Element receiverElement = elements[node.receiver];
@@ -1042,7 +1043,7 @@ abstract class InferrerVisitor<T, E extends MinimalInferrerEngine<T>>
}
} else {
// Narrow the elements to a non-null type.
- DartType objectType = closedWorld.commonElements.objectType;
+ ResolutionDartType objectType = closedWorld.commonElements.objectType;
if (Elements.isLocal(receiverElement)) {
narrow(receiverElement, objectType, node);
}
@@ -1148,21 +1149,21 @@ abstract class InferrerVisitor<T, E extends MinimalInferrerEngine<T>>
}
@override
- T visitIs(Send node, Node expression, DartType type, _) {
+ T visitIs(Send node, Node expression, ResolutionDartType type, _) {
potentiallyAddIsCheck(node);
visit(expression);
return types.boolType;
}
@override
- T visitIsNot(Send node, Node expression, DartType type, _) {
+ T visitIsNot(Send node, Node expression, ResolutionDartType type, _) {
potentiallyAddIsCheck(node);
visit(expression);
return types.boolType;
}
@override
- T visitAs(Send node, Node expression, DartType type, _) {
+ T visitAs(Send node, Node expression, ResolutionDartType type, _) {
T receiverType = visit(expression);
return types.narrowType(receiverType, type);
}
@@ -1360,7 +1361,7 @@ abstract class InferrerVisitor<T, E extends MinimalInferrerEngine<T>>
T visitCatchBlock(CatchBlock node) {
Node exception = node.exception;
if (exception != null) {
- DartType type = elements.getType(node.type);
+ ResolutionDartType type = elements.getType(node.type);
T mask = type == null || type.treatAsDynamic || type.isTypeVariable
? types.dynamicType
: types.nonNullSubtype(type.element);
« no previous file with comments | « pkg/compiler/lib/src/enqueue.dart ('k') | pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698