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

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

Issue 177963002: Use List instead of Link in the type system. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 6 years, 6 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/mixin_typevariable_test.dart ('k') | tests/compiler/dart2js/subtype_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/resolver_test.dart
diff --git a/tests/compiler/dart2js/resolver_test.dart b/tests/compiler/dart2js/resolver_test.dart
index 3107d36f66d554c0eabd7db7079e660677c183d2..e4bb95e2c963d03466c04b614e25bbfabe572da9 100644
--- a/tests/compiler/dart2js/resolver_test.dart
+++ b/tests/compiler/dart2js/resolver_test.dart
@@ -13,6 +13,7 @@ import "parser_helper.dart";
import 'package:compiler/implementation/dart_types.dart';
import 'package:compiler/implementation/elements/modelx.dart';
+import 'link_helper.dart';
Node buildIdentifier(String name) => new Identifier(scan(name));
@@ -21,7 +22,7 @@ Node buildInitialization(String name) =>
(parser, tokens) => parser.parseOptionallyInitializedIdentifier(tokens));
createLocals(List variables) {
- var locals = [];
+ var locals = <Node>[];
for (final variable in variables) {
String name = variable[0];
bool init = variable[1];
@@ -31,7 +32,7 @@ createLocals(List variables) {
locals.add(buildIdentifier(name));
}
}
- var definitions = new NodeList(null, new Link.fromList(locals), null, null);
+ var definitions = new NodeList(null, LinkFromList(locals), null, null);
return new VariableDefinitions(null, Modifiers.EMPTY, definitions);
}
@@ -134,14 +135,12 @@ Future testTypeVariables() {
visitor.visit(definition.type);
InterfaceType type = visitor.registry.mapping.getType(definition.type);
Expect.equals(definition.type.typeArguments.slowLength(),
- length(type.typeArguments));
+ type.typeArguments.length);
int index = 0;
- Link<DartType> arguments = type.typeArguments;
- while (!arguments.isEmpty) {
+ for (DartType argument in type.typeArguments) {
Expect.equals(true, index < expectedElements.length);
- Expect.equals(expectedElements[index], arguments.head.element);
+ Expect.equals(expectedElements[index], argument.element);
index++;
- arguments = arguments.tail;
}
Expect.equals(index, expectedElements.length);
}
« no previous file with comments | « tests/compiler/dart2js/mixin_typevariable_test.dart ('k') | tests/compiler/dart2js/subtype_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698