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

Side by Side Diff: tests/compiler/dart2js/resolver_test.dart

Issue 11418113: Substitution added to DartType (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'dart:uri'; 5 import 'dart:uri';
6 6
7 import "../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart" 7 import "../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart"
8 hide TreeElementMapping, TreeElements, SourceString; 8 hide TreeElementMapping, TreeElements, SourceString;
9 import "../../../sdk/lib/_internal/compiler/implementation/resolution/resolution .dart"; 9 import "../../../sdk/lib/_internal/compiler/implementation/resolution/resolution .dart";
10 import "../../../sdk/lib/_internal/compiler/implementation/elements/elements.dar t"; 10 import "../../../sdk/lib/_internal/compiler/implementation/elements/elements.dar t";
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 testIndexedOperator(); 78 testIndexedOperator();
79 testIncrementsAndDecrements(); 79 testIncrementsAndDecrements();
80 } 80 }
81 81
82 testTypeVariables() { 82 testTypeVariables() {
83 matchResolvedTypes(visitor, text, name, expectedElements) { 83 matchResolvedTypes(visitor, text, name, expectedElements) {
84 VariableDefinitions definition = parseStatement(text); 84 VariableDefinitions definition = parseStatement(text);
85 visitor.visit(definition.type); 85 visitor.visit(definition.type);
86 InterfaceType type = visitor.mapping.getType(definition.type); 86 InterfaceType type = visitor.mapping.getType(definition.type);
87 Expect.equals(definition.type.typeArguments.length(), 87 Expect.equals(definition.type.typeArguments.length(),
88 length(type.arguments)); 88 length(type.typeArguments));
89 int index = 0; 89 int index = 0;
90 Link<DartType> arguments = type.arguments; 90 Link<DartType> arguments = type.typeArguments;
91 while (!arguments.isEmpty) { 91 while (!arguments.isEmpty) {
92 Expect.equals(true, index < expectedElements.length); 92 Expect.equals(true, index < expectedElements.length);
93 Expect.equals(expectedElements[index], arguments.head.element); 93 Expect.equals(expectedElements[index], arguments.head.element);
94 index++; 94 index++;
95 arguments = arguments.tail; 95 arguments = arguments.tail;
96 } 96 }
97 Expect.equals(index, expectedElements.length); 97 Expect.equals(index, expectedElements.length);
98 } 98 }
99 99
100 MockCompiler compiler = new MockCompiler(); 100 MockCompiler compiler = new MockCompiler();
(...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after
807 var d = new D(); 807 var d = new D();
808 --d; 808 --d;
809 }"""; 809 }""";
810 final compiler = compileScript(script); 810 final compiler = compileScript(script);
811 811
812 checkMemberResolved(compiler, 'A', operatorName('+', false)); 812 checkMemberResolved(compiler, 'A', operatorName('+', false));
813 checkMemberResolved(compiler, 'B', operatorName('+', false)); 813 checkMemberResolved(compiler, 'B', operatorName('+', false));
814 checkMemberResolved(compiler, 'C', operatorName('-', false)); 814 checkMemberResolved(compiler, 'C', operatorName('-', false));
815 checkMemberResolved(compiler, 'D', operatorName('-', false)); 815 checkMemberResolved(compiler, 'D', operatorName('-', false));
816 } 816 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/world.dart ('k') | tests/compiler/dart2js/type_substitution_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698