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

Unified Diff: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java

Issue 15095009: Report CTEC.CONST_WITH_TYPE_PARAMETERS (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 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
Index: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
index cb7fe3d1690ae827c91fd0fa4e1cf4188638e694..35daf4bb4fbe19c94cf674eea0b2b633c4d132e2 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
@@ -40,15 +40,6 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
verify(source);
}
- public void fail_constWithTypeParameters() throws Exception {
- Source source = addSource(createSource(//
- // TODO
- ));
- resolve(source);
- assertErrors(CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS);
- verify(source);
- }
-
public void fail_duplicateDefinition() throws Exception {
Source source = addSource(createSource(//
"f() {",
@@ -915,6 +906,28 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
verify(source);
}
+ public void test_constWithTypeParameters_direct() throws Exception {
+ Source source = addSource(createSource(//
+ "class A<T> {",
+ " const V = const A<T>();",
+ " const A();",
+ "}"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS);
+ verify(source);
+ }
+
+ public void test_constWithTypeParameters_indirect() throws Exception {
+ Source source = addSource(createSource(//
+ "class A<T> {",
+ " const V = const A<List<T>>();",
+ " const A();",
+ "}"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS);
+ verify(source);
+ }
+
public void test_constWithUndefinedConstructor() throws Exception {
Source source = addSource(createSource(//
"class A {",

Powered by Google App Engine
This is Rietveld 408576698