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

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

Issue 59073003: Version 0.8.10.4 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 1 month 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: 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);
+ }
}

Powered by Google App Engine
This is Rietveld 408576698