| 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 c79e1b8c8e5f8199a7b727447b708d21154c713c..eb04a9ad8eb8643b2fc53c0556e9205f0d031408 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
|
| @@ -334,6 +334,50 @@ public class StaticTypeWarningCodeTest extends ResolverTestCase {
|
| assertErrors(StaticTypeWarningCode.UNDEFINED_METHOD);
|
| }
|
|
|
| + public void test_undefinedOperator_indexBoth() throws Exception {
|
| + Source source = addSource(createSource(//
|
| + "class A {}",
|
| + "f(A a) {",
|
| + " a[0]++;",
|
| + "}"));
|
| + resolve(source);
|
| + assertErrors(StaticTypeWarningCode.UNDEFINED_OPERATOR);
|
| + // no verify(), a[0] is not resolved
|
| + }
|
| +
|
| + public void test_undefinedOperator_indexGetter() throws Exception {
|
| + Source source = addSource(createSource(//
|
| + "class A {}",
|
| + "f(A a) {",
|
| + " a[0];",
|
| + "}"));
|
| + resolve(source);
|
| + assertErrors(StaticTypeWarningCode.UNDEFINED_OPERATOR);
|
| + // no verify(), a[0] is not resolved
|
| + }
|
| +
|
| + public void test_undefinedOperator_indexSetter() throws Exception {
|
| + Source source = addSource(createSource(//
|
| + "class A {}",
|
| + "f(A a) {",
|
| + " a[0] = 1;",
|
| + "}"));
|
| + resolve(source);
|
| + assertErrors(StaticTypeWarningCode.UNDEFINED_OPERATOR);
|
| + // no verify(), a[0] is not resolved
|
| + }
|
| +
|
| + public void test_undefinedOperator_plus() throws Exception {
|
| + Source source = addSource(createSource(//
|
| + "class A {}",
|
| + "f(A a) {",
|
| + " a + 1;",
|
| + "}"));
|
| + resolve(source);
|
| + assertErrors(StaticTypeWarningCode.UNDEFINED_OPERATOR);
|
| + // no verify(), 'a + 1' is not resolved
|
| + }
|
| +
|
| public void test_undefinedSetter() throws Exception {
|
| Source source = addSource(createSource(//
|
| "class T {}",
|
|
|