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

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

Issue 15736017: Issue 1015. Report problem for incompatible right operand and index types. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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/StaticWarningCodeTest.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java
index b12780eb46c175fae30a01d50a8677692db41849..3e2e0ef942865db9ad436953a9b9d23cf1f4ecda 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java
@@ -337,6 +337,32 @@ public class StaticWarningCodeTest extends ResolverTestCase {
assertErrors(StaticWarningCode.AMBIGUOUS_IMPORT);
}
+ public void test_argumentTypeNotAssignable_binary() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " operator +(int p) {}",
+ "}",
+ "f(A a) {",
+ " a + '0';",
+ "}"));
+ resolve(source);
+ assertErrors(StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE);
+ verify(source);
+ }
+
+ public void test_argumentTypeNotAssignable_index() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " operator [](int index) {}",
+ "}",
+ "f(A a) {",
+ " a['0'];",
+ "}"));
+ resolve(source);
+ assertErrors(StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE);
+ verify(source);
+ }
+
public void test_argumentTypeNotAssignable_invocation_generic() throws Exception {
Source source = addSource(createSource(//
"class A<T> {",

Powered by Google App Engine
This is Rietveld 408576698