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

Unified Diff: tests/compiler/dart2js/related_types.dart

Issue 2345083003: dart2js: run dartfmt on tests (Closed)
Patch Set: revert another multipart test Created 4 years, 3 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 | « tests/compiler/dart2js/regress_10231_test.dart ('k') | tests/compiler/dart2js/related_types_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/related_types.dart
diff --git a/tests/compiler/dart2js/related_types.dart b/tests/compiler/dart2js/related_types.dart
index d3f04e3c90a42279f96219cf1d88215772b8cac9..7d56a6508a6b4beee6ac56cd565c90a407d29744 100644
--- a/tests/compiler/dart2js/related_types.dart
+++ b/tests/compiler/dart2js/related_types.dart
@@ -103,19 +103,14 @@ class RelatedTypesChecker extends TraversalVisitor<DartType, dynamic> {
void checkRelated(Node node, DartType left, DartType right) {
if (hasEmptyIntersection(left, right)) {
reporter.reportHintMessage(
- node,
- MessageKind.NO_COMMON_SUBTYPES,
- {'left': left, 'right': right});
+ node, MessageKind.NO_COMMON_SUBTYPES, {'left': left, 'right': right});
}
}
/// Check weakly typed collection methods, like `Map.containsKey`,
/// `Map.containsValue` and `Iterable.contains`.
- void checkDynamicInvoke(
- Node node,
- DartType receiverType,
- List<DartType> argumentTypes,
- Selector selector) {
+ void checkDynamicInvoke(Node node, DartType receiverType,
+ List<DartType> argumentTypes, Selector selector) {
if (selector.name == 'containsKey' &&
selector.callStructure == CallStructure.ONE_ARG) {
InterfaceType mapType = findMapType(receiverType);
@@ -124,21 +119,21 @@ class RelatedTypesChecker extends TraversalVisitor<DartType, dynamic> {
checkRelated(node, keyType, argumentTypes.first);
}
} else if (selector.name == 'containsValue' &&
- selector.callStructure == CallStructure.ONE_ARG) {
+ selector.callStructure == CallStructure.ONE_ARG) {
InterfaceType mapType = findMapType(receiverType);
if (mapType != null) {
DartType valueType = findMapValueType(mapType);
checkRelated(node, valueType, argumentTypes.first);
}
} else if (selector.name == 'contains' &&
- selector.callStructure == CallStructure.ONE_ARG) {
+ selector.callStructure == CallStructure.ONE_ARG) {
InterfaceType iterableType = findIterableType(receiverType);
if (iterableType != null) {
DartType elementType = findIterableElementType(iterableType);
checkRelated(node, elementType, argumentTypes.first);
}
} else if (selector.name == 'remove' &&
- selector.callStructure == CallStructure.ONE_ARG) {
+ selector.callStructure == CallStructure.ONE_ARG) {
InterfaceType mapType = findMapType(receiverType);
if (mapType != null) {
DartType keyType = findMapKeyType(mapType);
@@ -361,61 +356,47 @@ class RelatedTypesChecker extends TraversalVisitor<DartType, dynamic> {
@override
DartType visitDynamicPropertyInvoke(
- Send node,
- Node receiver,
- NodeList arguments,
- Selector selector, _) {
+ Send node, Node receiver, NodeList arguments, Selector selector, _) {
DartType receiverType = apply(receiver);
List<DartType> argumentTypes = findArgumentTypes(arguments);
- FunctionType methodType = lookupInterfaceMemberInvocationType(
- receiverType, selector.memberName);
+ FunctionType methodType =
+ lookupInterfaceMemberInvocationType(receiverType, selector.memberName);
checkDynamicInvoke(node, receiverType, argumentTypes, selector);
return findReturnType(methodType);
}
@override
DartType visitThisPropertyInvoke(
- Send node,
- NodeList arguments,
- Selector selector, _) {
+ Send node, NodeList arguments, Selector selector, _) {
DartType receiverType = thisType;
List<DartType> argumentTypes = findArgumentTypes(arguments);
- FunctionType methodType = lookupInterfaceMemberInvocationType(
- receiverType, selector.memberName);
+ FunctionType methodType =
+ lookupInterfaceMemberInvocationType(receiverType, selector.memberName);
checkDynamicInvoke(node, receiverType, argumentTypes, selector);
return findReturnType(methodType);
}
@override
DartType visitIfNotNullDynamicPropertyInvoke(
- Send node,
- Node receiver,
- NodeList arguments,
- Selector selector, _) {
+ Send node, Node receiver, NodeList arguments, Selector selector, _) {
DartType receiverType = apply(receiver);
List<DartType> argumentTypes = findArgumentTypes(arguments);
- FunctionType methodType = lookupInterfaceMemberInvocationType(
- receiverType, selector.memberName);
+ FunctionType methodType =
+ lookupInterfaceMemberInvocationType(receiverType, selector.memberName);
checkDynamicInvoke(node, receiverType, argumentTypes, selector);
return findReturnType(methodType);
}
@override
- DartType visitTopLevelFunctionInvoke(
- Send node,
- MethodElement function,
- NodeList arguments,
- CallStructure callStructure, _) {
+ DartType visitTopLevelFunctionInvoke(Send node, MethodElement function,
+ NodeList arguments, CallStructure callStructure, _) {
apply(arguments);
return findReturnType(function.type);
}
@override
- DartType visitStaticFunctionInvoke(
- Send node,
- MethodElement function,
- NodeList arguments,
- CallStructure callStructure, _) {
+ DartType visitStaticFunctionInvoke(Send node, MethodElement function,
+ NodeList arguments, CallStructure callStructure, _) {
apply(arguments);
return findReturnType(function.type);
}
@@ -435,4 +416,4 @@ class ClassFinder extends BaseDartTypeVisitor<ClassElement, dynamic> {
ClassElement visitInterfaceType(InterfaceType type, _) {
return type.element;
}
-}
+}
« no previous file with comments | « tests/compiler/dart2js/regress_10231_test.dart ('k') | tests/compiler/dart2js/related_types_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698