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

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

Issue 23189012: Fix for issue 11708 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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/StaticTypeWarningCodeTest.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticTypeWarningCodeTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticTypeWarningCodeTest.java
index f11947aa2645727b0677f217ed1dc7cf44530013..e408f11b58dc47fca239b6bef24d83029317cfd3 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticTypeWarningCodeTest.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticTypeWarningCodeTest.java
@@ -789,6 +789,51 @@ public class StaticTypeWarningCodeTest extends ResolverTestCase {
assertErrors(StaticTypeWarningCode.UNDEFINED_SUPER_METHOD);
}
+ public void test_unqualifiedReferenceToNonLocalStaticMember_getter() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " static int get a => 0;",
+ "}",
+ "class B extends A {",
+ " int b() {",
+ " return a;",
+ " }",
+ "}"));
+ resolve(source);
+ assertErrors(StaticTypeWarningCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER);
+ verify(source);
+ }
+
+ public void test_unqualifiedReferenceToNonLocalStaticMember_method() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " static void a() {}",
+ "}",
+ "class B extends A {",
+ " void b() {",
+ " a();",
+ " }",
+ "}"));
+ resolve(source);
+ assertErrors(StaticTypeWarningCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER);
+ verify(source);
+ }
+
+ public void test_unqualifiedReferenceToNonLocalStaticMember_setter() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " static set a(x) {}",
+ "}",
+ "class B extends A {",
+ " b(y) {",
+ " a = y;",
+ " }",
+ "}"));
+ resolve(source);
+ assertErrors(StaticTypeWarningCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER);
+ verify(source);
+ }
+
public void test_wrongNumberOfTypeArguments_tooFew() throws Exception {
Source source = addSource(createSource(//
"class A<E, F> {}",

Powered by Google App Engine
This is Rietveld 408576698