| Index: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java
|
| diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java
|
| index 07cea17cd14312001ba6fa8e24483adf5232ff66..8f6938c6ab63bed0f5ca7daeb3e23a0ad6e7b48f 100644
|
| --- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java
|
| +++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java
|
| @@ -1234,6 +1234,39 @@ public class StaticWarningCodeTest extends ResolverTestCase {
|
| verify(source);
|
| }
|
|
|
| + public void test_newWithInvalidTypeParameters() throws Exception {
|
| + Source source = addSource(createSource(//
|
| + "class A {}",
|
| + "f() { return new A<A>(); }"));
|
| + resolve(source);
|
| + assertErrors(StaticWarningCode.NEW_WITH_INVALID_TYPE_PARAMETERS);
|
| + verify(source);
|
| + }
|
| +
|
| + public void test_newWithInvalidTypeParameters_tooFew() throws Exception {
|
| + Source source = addSource(createSource(//
|
| + "class A {}",
|
| + "class C<K, V> {}",
|
| + "f(p) {",
|
| + " return new C<A>();",
|
| + "}"));
|
| + resolve(source);
|
| + assertErrors(StaticWarningCode.NEW_WITH_INVALID_TYPE_PARAMETERS);
|
| + verify(source);
|
| + }
|
| +
|
| + public void test_newWithInvalidTypeParameters_tooMany() throws Exception {
|
| + Source source = addSource(createSource(//
|
| + "class A {}",
|
| + "class C<E> {}",
|
| + "f(p) {",
|
| + " return new C<A, A>();",
|
| + "}"));
|
| + resolve(source);
|
| + assertErrors(StaticWarningCode.NEW_WITH_INVALID_TYPE_PARAMETERS);
|
| + verify(source);
|
| + }
|
| +
|
| public void test_newWithNonType() throws Exception {
|
| Source source = addSource(createSource(//
|
| "var A = 0;",
|
|
|