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

Unified Diff: compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java

Issue 8317004: DartC: Replace Array by List in the type-checker. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years, 2 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 | « no previous file | compiler/javatests/com/google/dart/compiler/type/TypeTest.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java
diff --git a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java
index 443c917699208938b60e859fca032f5158038e02..a8c86160ec6ea9927d09b1041b4d1cda032189c0 100644
--- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java
+++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java
@@ -82,27 +82,27 @@ public class TypeAnalyzerTest extends TypeTestCase {
// break
analyze("foo() { L: for (;true;) { break L; } }");
- analyze("foo() { int x; Array<int> c; L: for (x in c) { break L; } }");
- analyze("foo() { Array<int> c; L: for (var x in c) { break L; } }");
+ analyze("foo() { int x; List<int> c; L: for (x in c) { break L; } }");
+ analyze("foo() { List<int> c; L: for (var x in c) { break L; } }");
analyze("foo() { L: while (true) { break L; } }");
analyze("foo() { L: do { break L; } while (true); }");
analyze("foo() { L: for (;true;) { for (;true;) { break L; } } }");
- analyze("foo() { int x; Array<int> c; L: for (x in c) { for (;true;) { break L; } } }");
- analyze("foo() { Array<int> c; L: for (var x in c) { for (;true;) { break L; } } }");
+ analyze("foo() { int x; List<int> c; L: for (x in c) { for (;true;) { break L; } } }");
+ analyze("foo() { List<int> c; L: for (var x in c) { for (;true;) { break L; } } }");
analyze("foo() { L: while (true) { for (;true;) { break L; } } }");
analyze("foo() { L: do { for (;true;) { break L; } } while (true); }");
// continue
analyze("foo() { L: for (;true;) { continue L; } }");
- analyze("foo() { int x; Array<int> c; L: for (x in c) { continue L; } }");
- analyze("foo() { Array<int> c; L: for (var x in c) { continue L; } }");
+ analyze("foo() { int x; List<int> c; L: for (x in c) { continue L; } }");
+ analyze("foo() { List<int> c; L: for (var x in c) { continue L; } }");
analyze("foo() { L: do { continue L; } while (true); }");
analyze("foo() { L: for (;true;) { for (;true;) { continue L; } } }");
analyze(
- "foo() { int x; Array<int> c; L: for (x in c) { for (;true;) { continue L; } } }");
- analyze("foo() { Array<int> c; L: for (var x in c) { for (;true;) { continue L; } } }");
+ "foo() { int x; List<int> c; L: for (x in c) { for (;true;) { continue L; } } }");
+ analyze("foo() { List<int> c; L: for (var x in c) { for (;true;) { continue L; } } }");
analyze("foo() { L: while (true) { for (;true;) { continue L; } } }");
analyze("foo() { L: do { for (;true;) { continue L; } } while (true); }");
@@ -189,7 +189,7 @@ public class TypeAnalyzerTest extends TypeTestCase {
public void testMethodInvocations() {
loadFile("class_with_methods.dart");
- final String header = "{ ClassWithMethods c; int i, j; Array array; ";
ngeoffray 2011/10/17 14:27:06 'array' was not used?
karlklose 2011/10/18 07:52:52 No, it is not used.
+ final String header = "{ ClassWithMethods c; int i, j; ";
analyze(header + "int k = c.untypedNoArgumentMethod(); }");
analyze(header + "ClassWithMethods x = c.untypedNoArgumentMethod(); }");
@@ -224,7 +224,7 @@ public class TypeAnalyzerTest extends TypeTestCase {
public void testMethodInvocationArgumentCount() {
loadFile("class_with_methods.dart");
- final String header = "{ ClassWithMethods c; Array array; ";
ngeoffray 2011/10/17 14:27:06 ditto
karlklose 2011/10/18 07:52:52 It was also not used here.
+ final String header = "{ ClassWithMethods c; ";
analyzeFail(header + "c.untypedNoArgumentMethod(1); }",
DartCompilerErrorCode.EXTRA_ARGUMENT);
@@ -1187,14 +1187,14 @@ public class TypeAnalyzerTest extends TypeTestCase {
analyze("<String>['x'];");
analyzeFail("<int>['x'];", DartCompilerErrorCode.TYPE_NOT_ASSIGNMENT_COMPATIBLE);
analyzeFail("<String>['x', 1];", DartCompilerErrorCode.TYPE_NOT_ASSIGNMENT_COMPATIBLE);
- analyze("Array<String> strings = ['x'];");
- analyze("Array<String> strings = <String>['x'];");
- analyze("Array array = ['x'];");
- analyze("Array array = <String>['x'];");
- analyze("Array<int> ints = ['x'];");
- analyzeFail("Array<int> ints = <String>['x'];",
+ analyze("List<String> strings = ['x'];");
+ analyze("List<String> strings = <String>['x'];");
+ analyze("List array = ['x'];");
+ analyze("List array = <String>['x'];");
+ analyze("List<int> ints = ['x'];");
+ analyzeFail("List<int> ints = <String>['x'];",
DartCompilerErrorCode.TYPE_NOT_ASSIGNMENT_COMPATIBLE);
- analyzeFail("Array<int, int> ints = [1];",
+ analyzeFail("List<int, int> ints = [1];",
DartCompilerErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS);
}
@@ -1548,7 +1548,7 @@ public class TypeAnalyzerTest extends TypeTestCase {
@Override
public InterfaceType getArrayType(Type elementType) {
- return array.getType().subst(Arrays.asList(elementType), array.getTypeParameters());
+ return list.getType().subst(Arrays.asList(elementType), list.getTypeParameters());
}
@Override
« no previous file with comments | « no previous file | compiler/javatests/com/google/dart/compiler/type/TypeTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698