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

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

Issue 56773002: Issue 13241. Report StaticWarningCode.CONFLICTING_INSTANCE_METHOD_SETTER. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Use InheritanceManager Created 7 years, 1 month 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 f9ddc1adac03878a26d569e709f32b3fa39c2712..cb9b9257d3d0e546d95e359fd9a964357512524e 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
@@ -829,6 +829,43 @@ public class StaticWarningCodeTest extends ResolverTestCase {
verify(source);
}
+ public void test_conflictingInstanceMethodSetter_sameClass() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " foo() {}",
+ " set foo(a) {}",
+ "}"));
+ resolve(source);
+ assertErrors(source, StaticWarningCode.CONFLICTING_INSTANCE_METHOD_SETTER);
+ verify(source);
+ }
+
+ public void test_conflictingInstanceMethodSetter_setterInInterface() throws Exception {
+ Source source = addSource(createSource(//
+ "abstract class A {",
+ " set foo(a);",
+ "}",
+ "abstract class B implements A {",
+ " foo() {}",
+ "}"));
+ resolve(source);
+ assertErrors(source, StaticWarningCode.CONFLICTING_INSTANCE_METHOD_SETTER);
+ verify(source);
+ }
+
+ public void test_conflictingInstanceMethodSetter_setterInSuper() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " set foo(a) {}",
+ "}",
+ "class B extends A {",
+ " foo() {}",
+ "}"));
+ resolve(source);
+ assertErrors(source, StaticWarningCode.CONFLICTING_INSTANCE_METHOD_SETTER);
+ verify(source);
+ }
+
public void test_conflictingInstanceSetterAndSuperclassMember() throws Exception {
Source source = addSource(createSource(//
"class A {",

Powered by Google App Engine
This is Rietveld 408576698