| 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 9173481a3487e7e02b994f33232fd6ba8547794a..31f81e4d3e9a3e48ec521a8aa1d4d7c4008c32e8 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
|
| @@ -83,6 +83,71 @@ public class StaticTypeWarningCodeTest extends ResolverTestCase {
|
| verify(source);
|
| }
|
|
|
| + public void test_instanceAccessToStaticMember_method_invocation() throws Exception {
|
| + Source source = addSource(createSource(//
|
| + "class A {",
|
| + " static m() {}",
|
| + "}",
|
| + "main(A a) {",
|
| + " a.m();",
|
| + "}"));
|
| + resolve(source);
|
| + assertErrors(StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER);
|
| + verify(source);
|
| + }
|
| +
|
| + public void test_instanceAccessToStaticMember_method_reference() throws Exception {
|
| + Source source = addSource(createSource(//
|
| + "class A {",
|
| + " static m() {}",
|
| + "}",
|
| + "main(A a) {",
|
| + " a.m;",
|
| + "}"));
|
| + resolve(source);
|
| + assertErrors(StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER);
|
| + verify(source);
|
| + }
|
| +
|
| + public void test_instanceAccessToStaticMember_propertyAccess_field() throws Exception {
|
| + Source source = addSource(createSource(//
|
| + "class A {",
|
| + " static var f;",
|
| + "}",
|
| + "main(A a) {",
|
| + " a.f;",
|
| + "}"));
|
| + resolve(source);
|
| + assertErrors(StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER);
|
| + verify(source);
|
| + }
|
| +
|
| + public void test_instanceAccessToStaticMember_propertyAccess_getter() throws Exception {
|
| + Source source = addSource(createSource(//
|
| + "class A {",
|
| + " static get f => 42;",
|
| + "}",
|
| + "main(A a) {",
|
| + " a.f;",
|
| + "}"));
|
| + resolve(source);
|
| + assertErrors(StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER);
|
| + verify(source);
|
| + }
|
| +
|
| + public void test_instanceAccessToStaticMember_propertyAccess_setter() throws Exception {
|
| + Source source = addSource(createSource(//
|
| + "class A {",
|
| + " static set f(x) {}",
|
| + "}",
|
| + "main(A a) {",
|
| + " a.f = 42;",
|
| + "}"));
|
| + resolve(source);
|
| + assertErrors(StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER);
|
| + verify(source);
|
| + }
|
| +
|
| public void test_invalidAssignment_compoundAssignment() throws Exception {
|
| Source source = addSource(createSource(//
|
| "class byte {",
|
|
|