Index: dart/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java |
=================================================================== |
--- dart/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java (revision 29808) |
+++ dart/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java (working copy) |
@@ -15,6 +15,7 @@ |
import com.google.dart.engine.error.CompileTimeErrorCode; |
import com.google.dart.engine.error.HintCode; |
+import com.google.dart.engine.error.StaticTypeWarningCode; |
import com.google.dart.engine.error.StaticWarningCode; |
import com.google.dart.engine.source.Source; |
@@ -51,28 +52,6 @@ |
verify(source); |
} |
- public void fail_undefinedStaticMethodOrGetter_getter() throws Exception { |
- Source source = addSource(createSource(// |
- "class C {}", |
- "f(var p) {", |
- " f(C.m);", |
- "}")); |
- resolve(source); |
- assertErrors(source, StaticWarningCode.UNDEFINED_STATIC_METHOD_OR_GETTER); |
- verify(source); |
- } |
- |
- public void fail_undefinedStaticMethodOrGetter_method() throws Exception { |
- Source source = addSource(createSource(// |
- "class C {}", |
- "f(var p) {", |
- " f(C.m());", |
- "}")); |
- resolve(source); |
- assertErrors(source, StaticWarningCode.UNDEFINED_STATIC_METHOD_OR_GETTER); |
- verify(source); |
- } |
- |
public void test_ambiguousImport_as() throws Exception { |
Source source = addSource(createSource(// |
"import 'lib1.dart';", |
@@ -2383,4 +2362,68 @@ |
resolve(source2); |
assertErrors(source2, StaticWarningCode.UNDEFINED_SETTER); |
} |
+ |
+ // See comment on StaticWarningCode.UNDEFINED_STATIC_METHOD_OR_GETTER |
+ public void test_undefinedStaticMethodOrGetter_getter() throws Exception { |
+ Source source = addSource(createSource(// |
+ "class C {}", |
+ "f(var p) {", |
+ " f(C.m);", |
+ "}")); |
+ resolve(source); |
+ assertErrors(source, StaticTypeWarningCode.UNDEFINED_GETTER); |
+ } |
+ |
+ // See comment on StaticWarningCode.UNDEFINED_STATIC_METHOD_OR_GETTER |
+ public void test_undefinedStaticMethodOrGetter_getter_inSuperclass() throws Exception { |
+ Source source = addSource(createSource(// |
+ "class S {", |
+ " static int get g => 0;", |
+ "}", |
+ "class C extends S {}", |
+ "f(var p) {", |
+ " f(C.g);", |
+ "}")); |
+ resolve(source); |
+ assertErrors(source, StaticTypeWarningCode.UNDEFINED_GETTER); |
+ } |
+ |
+ // See comment on StaticWarningCode.UNDEFINED_STATIC_METHOD_OR_GETTER |
+ public void test_undefinedStaticMethodOrGetter_method() throws Exception { |
+ Source source = addSource(createSource(// |
+ "class C {}", |
+ "f(var p) {", |
+ " f(C.m());", |
+ "}")); |
+ resolve(source); |
+ assertErrors(source, StaticTypeWarningCode.UNDEFINED_METHOD); |
+ } |
+ |
+ // See comment on StaticWarningCode.UNDEFINED_STATIC_METHOD_OR_GETTER |
+ public void test_undefinedStaticMethodOrGetter_method_inSuperclass() throws Exception { |
+ Source source = addSource(createSource(// |
+ "class S {", |
+ " static m() {}", |
+ "}", |
+ "class C extends S {}", |
+ "f(var p) {", |
+ " f(C.m());", |
+ "}")); |
+ resolve(source); |
+ assertErrors(source, StaticTypeWarningCode.UNDEFINED_METHOD); |
+ } |
+ |
+ // See comment on StaticWarningCode.UNDEFINED_STATIC_METHOD_OR_GETTER |
+ public void test_undefinedStaticMethodOrGetter_setter_inSuperclass() throws Exception { |
+ Source source = addSource(createSource(// |
+ "class S {", |
+ " static set s(int i) {}", |
+ "}", |
+ "class C extends S {}", |
+ "f(var p) {", |
+ " f(C.s = 1);", |
+ "}")); |
+ resolve(source); |
+ assertErrors(source, StaticTypeWarningCode.UNDEFINED_SETTER); |
+ } |
} |