| 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 3c820d65d586139f89a5ead7291816d5c80e98d2..73dc398cd37d7fd4177badb78e498d4d42dc6feb 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
|
| @@ -1666,6 +1666,68 @@ public class StaticWarningCodeTest extends ResolverTestCase {
|
| verify(source);
|
| }
|
|
|
| + public void test_typeParameterReferencedByStatic_field() throws Exception {
|
| + Source source = addSource(createSource(//
|
| + "class A<K> {",
|
| + " static K k;",
|
| + "}"));
|
| + resolve(source);
|
| + assertErrors(StaticWarningCode.TYPE_PARAMETER_REFERENCED_BY_STATIC);
|
| + verify(source);
|
| + }
|
| +
|
| + public void test_typeParameterReferencedByStatic_getter() throws Exception {
|
| + Source source = addSource(createSource(//
|
| + "class A<K> {",
|
| + " static K get k => 0;",
|
| + "}"));
|
| + resolve(source);
|
| + assertErrors(StaticWarningCode.TYPE_PARAMETER_REFERENCED_BY_STATIC);
|
| + verify(source);
|
| + }
|
| +
|
| + public void test_typeParameterReferencedByStatic_methodBodyReference() throws Exception {
|
| + Source source = addSource(createSource(//
|
| + "class A<K> {",
|
| + " static m() {",
|
| + " K k;",
|
| + " }",
|
| + "}"));
|
| + resolve(source);
|
| + assertErrors(StaticWarningCode.TYPE_PARAMETER_REFERENCED_BY_STATIC);
|
| + verify(source);
|
| + }
|
| +
|
| + public void test_typeParameterReferencedByStatic_methodParameter() throws Exception {
|
| + Source source = addSource(createSource(//
|
| + "class A<K> {",
|
| + " static m(K k) {}",
|
| + "}"));
|
| + resolve(source);
|
| + assertErrors(StaticWarningCode.TYPE_PARAMETER_REFERENCED_BY_STATIC);
|
| + verify(source);
|
| + }
|
| +
|
| + public void test_typeParameterReferencedByStatic_methodReturn() throws Exception {
|
| + Source source = addSource(createSource(//
|
| + "class A<K> {",
|
| + " static K m() {}",
|
| + "}"));
|
| + resolve(source);
|
| + assertErrors(StaticWarningCode.TYPE_PARAMETER_REFERENCED_BY_STATIC);
|
| + verify(source);
|
| + }
|
| +
|
| + public void test_typeParameterReferencedByStatic_setter() throws Exception {
|
| + Source source = addSource(createSource(//
|
| + "class A<K> {",
|
| + " static set s(K k) {}",
|
| + "}"));
|
| + resolve(source);
|
| + assertErrors(StaticWarningCode.TYPE_PARAMETER_REFERENCED_BY_STATIC);
|
| + verify(source);
|
| + }
|
| +
|
| public void test_typeTestNonType() throws Exception {
|
| Source source = addSource(createSource(//
|
| "var A = 0;",
|
|
|