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

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

Issue 218993013: Fix for 16133 - Warnings for both required getters and setters in concrete subclasses will appear (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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 c4c7c02504acef38c7688897096720799bf70db7..d7cf27abc34dfef09257d5371890aaf286b649b8 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
@@ -2112,6 +2112,36 @@ public class StaticWarningCodeTest extends ResolverTestCase {
verify(source);
}
+ public void test_nonAbstractClassInheritsAbstractMemberOne_variable_fromInterface_missingGetter()
+ throws Exception {
+ // 16133
+ Source source = addSource(createSource(//
+ "class I {",
+ " var v;",
+ "}",
+ "class C implements I {",
+ " set v(_) {}",
+ "}"));
+ resolve(source);
+ assertErrors(source, StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE);
+ verify(source);
+ }
+
+ public void test_nonAbstractClassInheritsAbstractMemberOne_variable_fromInterface_missingSetter()
+ throws Exception {
+ // 16133
+ Source source = addSource(createSource(//
+ "class I {",
+ " var v;",
+ "}",
+ "class C implements I {",
+ " get v => 1;",
+ "}"));
+ resolve(source);
+ assertErrors(source, StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE);
+ verify(source);
+ }
+
public void test_nonAbstractClassInheritsAbstractMemberThree() throws Exception {
Source source = addSource(createSource(//
"abstract class A {",
@@ -2139,6 +2169,20 @@ public class StaticWarningCodeTest extends ResolverTestCase {
verify(source);
}
+ public void test_nonAbstractClassInheritsAbstractMemberTwo_variable_fromInterface_missingBoth()
+ throws Exception {
+ // 16133
+ Source source = addSource(createSource(//
+ "class I {",
+ " var v;",
+ "}",
+ "class C implements I {",
+ "}"));
+ resolve(source);
+ assertErrors(source, StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO);
+ verify(source);
+ }
+
public void test_nonTypeInCatchClause_noElement() throws Exception {
Source source = addSource(createSource(//
"f() {",

Powered by Google App Engine
This is Rietveld 408576698