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

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

Issue 17587004: Report CompileTimeErrorCode.INSTANCE_STATIC_MEMBER (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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/CompileTimeErrorCodeTest.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
index 6cd8bf7827b2cbec2839d989b11f1a7139a16340..bcf593bb5b80f3a7d2bbcea1dadfa6d66555ba2d 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
@@ -1479,6 +1479,58 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
verify(source);
}
+ public void test_instanceStaticMember_instanceMethod_staticField() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " x() {}",
+ "}",
+ "class B extends A {",
+ " static int x;",
+ "}"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.INSTANCE_STATIC_MEMBER);
+ verify(source);
+ }
+
+ public void test_instanceStaticMember_instanceMethod_staticMethod() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " x() {}",
+ "}",
+ "class B extends A {",
+ " static x() {}",
+ "}"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.INSTANCE_STATIC_MEMBER);
+ verify(source);
+ }
+
+ public void test_instanceStaticMember_instanceMethodAbstract_staticField() throws Exception {
+ Source source = addSource(createSource(//
+ "abstract class A {",
+ " x();",
+ "}",
+ "abstract class B extends A {",
+ " static int x;",
+ "}"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.INSTANCE_STATIC_MEMBER);
+ verify(source);
+ }
+
+ public void test_instanceStaticMember_instanceMethodAbstract_staticMethod() throws Exception {
+ Source source = addSource(createSource(//
+ "abstract class A {",
+ " x();",
+ "}",
+ "abstract class B extends A {",
+ " static x() {}",
+ "}"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.INSTANCE_STATIC_MEMBER);
+ verify(source);
+ }
+
public void test_invalidConstructorName_notEnclosingClassName() throws Exception {
Source source = addSource(createSource(//
"class A {",

Powered by Google App Engine
This is Rietveld 408576698