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

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

Issue 17587006: Report CTEC.INSTANCE_MEMBER_ACCESS_FROM_STATIC (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..21757cd235358f1e0c037485f094af4028f7e647 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,45 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
verify(source);
}
+ public void test_instanceMemberAccessFromStatic_field() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " int f;",
+ " static foo() {",
+ " f;",
+ " }",
+ "}"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_STATIC);
+ verify(source);
+ }
+
+ public void test_instanceMemberAccessFromStatic_getter() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " get g => null;",
+ " static foo() {",
+ " g;",
+ " }",
+ "}"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_STATIC);
+ verify(source);
+ }
+
+ public void test_instanceMemberAccessFromStatic_method() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " m() {}",
+ " static foo() {",
+ " m();",
+ " }",
+ "}"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_STATIC);
+ verify(source);
+ }
+
public void test_invalidConstructorName_notEnclosingClassName() throws Exception {
Source source = addSource(createSource(//
"class A {",

Powered by Google App Engine
This is Rietveld 408576698