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

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

Issue 11571029: Issue 6971. Don't report error for using built-in identifier as part of parameterized type. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
diff --git a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
index 6461b394558bcfb887a046ac4b709312484d902a..31bb3ca82365a3e949f6f8d7c02a7eda16f1cdfe 100644
--- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
+++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
@@ -6066,4 +6066,43 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
assertErrors(result.getErrors(),
errEx(TypeErrorCode.FOR_IN_WITH_INVALID_ITERATOR_RETURN_TYPE, 7, 17, 1));
}
+
+ public void test_builtInIdentifier_asType() throws Exception {
+ AnalyzeLibraryResult result = analyzeLibrary(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "main() {",
+ " abstract v_abstract;",
+ "}",
+ "");
+ assertErrors(result.getErrors(),
+ errEx(ResolverErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE, 3, 3, 8));
+ }
+
+ public void test_builtInIdentifier_asParameterizedType() throws Exception {
+ AnalyzeLibraryResult result = analyzeLibrary(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "main() {",
+ " abstract<int> v_01;",
+ " as<int> v_02;",
+ " export<int> v_03;",
+ " external<int> v_04;",
+ " factory<int> v_05;",
+ " get<int> v_06;",
+ " implements<int> v_07;",
+ " import<int> v_08;",
+ " library<int> v_09;",
+ " operator<int> v_q0;",
+ " part<int> v_11;",
+ " set<int> v_12;",
+ " static<int> v_13;",
+ " typedef<int> v_14;",
+ "}",
+ "");
+ List<DartCompilationError> errors = result.getErrors();
+ assertEquals(14, errors.size());
+ for (DartCompilationError error : errors) {
+ assertSame(TypeErrorCode.NO_SUCH_TYPE, error.getErrorCode());
+ assertEquals(3, error.getColumnNumber());
+ }
+ }
}
« no previous file with comments | « compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java ('k') | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698