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

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

Issue 15813002: Issue 8801. Report problems for missing [] or []= (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Tweak for problem description, report only one problem Created 7 years, 7 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 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 {}",

Powered by Google App Engine
This is Rietveld 408576698