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> {", |