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

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

Issue 66253002: Version 0.8.10.9 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: 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: dart/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java
===================================================================
--- dart/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java (revision 30098)
+++ dart/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java (working copy)
@@ -729,20 +729,22 @@
assertErrors(source, StaticWarningCode.CONFLICTING_DART_IMPORT);
}
- public void test_conflictingInstanceGetterAndSuperclassMember_direct_field() throws Exception {
+ public void test_conflictingInstanceGetterAndSuperclassMember_declField_direct_setter()
+ throws Exception {
Source source = addSource(createSource(//
"class A {",
- " static int v;",
+ " static set v(x) {}",
"}",
"class B extends A {",
- " get v => 0;",
+ " var v;",
"}"));
resolve(source);
assertErrors(source, StaticWarningCode.CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER);
verify(source);
}
- public void test_conflictingInstanceGetterAndSuperclassMember_direct_getter() throws Exception {
+ public void test_conflictingInstanceGetterAndSuperclassMember_declGetter_direct_getter()
+ throws Exception {
Source source = addSource(createSource(//
"class A {",
" static get v => 0;",
@@ -755,7 +757,8 @@
verify(source);
}
- public void test_conflictingInstanceGetterAndSuperclassMember_direct_method() throws Exception {
+ public void test_conflictingInstanceGetterAndSuperclassMember_declGetter_direct_method()
+ throws Exception {
Source source = addSource(createSource(//
"class A {",
" static v() {}",
@@ -768,7 +771,8 @@
verify(source);
}
- public void test_conflictingInstanceGetterAndSuperclassMember_direct_setter() throws Exception {
+ public void test_conflictingInstanceGetterAndSuperclassMember_declGetter_direct_setter()
+ throws Exception {
Source source = addSource(createSource(//
"class A {",
" static set v(x) {}",
@@ -781,7 +785,8 @@
verify(source);
}
- public void test_conflictingInstanceGetterAndSuperclassMember_indirect() throws Exception {
+ public void test_conflictingInstanceGetterAndSuperclassMember_declGetter_indirect()
+ throws Exception {
Source source = addSource(createSource(//
"class A {",
" static int v;",
@@ -795,7 +800,7 @@
verify(source);
}
- public void test_conflictingInstanceGetterAndSuperclassMember_mixin() throws Exception {
+ public void test_conflictingInstanceGetterAndSuperclassMember_declGetter_mixin() throws Exception {
Source source = addSource(createSource(//
"class M {",
" static int v;",
@@ -808,6 +813,56 @@
verify(source);
}
+ public void test_conflictingInstanceGetterAndSuperclassMember_direct_field() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " static int v;",
+ "}",
+ "class B extends A {",
+ " get v => 0;",
+ "}"));
+ resolve(source);
+ assertErrors(source, StaticWarningCode.CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER);
+ 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