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

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

Issue 178173003: Fix for 16498. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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 1a4d9003f7aba3bb5fa26acb40685477e83a4a1a..0b9a918f35c6ab3176a27252736b2db391c28a1e 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
@@ -1307,6 +1307,24 @@ public class StaticWarningCodeTest extends ResolverTestCase {
verify(source);
}
+ public void test_invalidGetterOverrideReturnType_twoMethods() throws Exception {
+ // test from language/override_inheritance_field_test_11.dart
+ Source source = addSource(createSource(//
+ "abstract class I {",
+ " int get getter => null;",
+ "}",
+ "abstract class J {",
+ " num get getter => null;",
+ "}",
+ "abstract class A implements I, J {}",
+ "class B extends A {",
+ " String get getter => null;",
+ "}"));
+ resolve(source);
+ assertErrors(source, StaticWarningCode.INVALID_GETTER_OVERRIDE_RETURN_TYPE);
+ verify(source);
+ }
+
public void test_invalidMethodOverrideNamedParamType() throws Exception {
Source source = addSource(createSource(//
"class A {",
@@ -1545,6 +1563,24 @@ public class StaticWarningCodeTest extends ResolverTestCase {
verify(source);
}
+ public void test_invalidSetterOverrideNormalParamType_twoMethods() throws Exception {
+ // test from language/override_inheritance_field_test_34.dart
+ Source source = addSource(createSource(//
+ "abstract class I {",
+ " set setter14(int _) => null;",
+ "}",
+ "abstract class J {",
+ " set setter14(num _) => null;",
+ "}",
+ "abstract class A implements I, J {}",
+ "class B extends A {",
+ " set setter14(String _) => null;",
+ "}"));
+ resolve(source);
+ assertErrors(source, StaticWarningCode.INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE);
+ verify(source);
+ }
+
public void test_listElementTypeNotAssignable() throws Exception {
Source source = addSource(createSource(//
"var v = <String> [42];"));
@@ -1901,6 +1937,24 @@ public class StaticWarningCodeTest extends ResolverTestCase {
verify(source);
}
+ public void test_nonAbstractClassInheritsAbstractMemberOne_setter_and_implicitSetter()
+ throws Exception {
+ // test from language/override_inheritance_abstract_test_14.dart
+ Source source = addSource(createSource(//
+ "abstract class A {",
+ " set field(_);",
+ "}",
+ "abstract class I {",
+ " var field;",
+ "}",
+ "class B extends A implements I {",
+ " get field => 0;",
+ "}"));
+ resolve(source);
+ assertErrors(source, StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE);
+ verify(source);
+ }
+
public void test_nonAbstractClassInheritsAbstractMemberOne_setter_fromInterface()
throws Exception {
Source source = addSource(createSource(//

Powered by Google App Engine
This is Rietveld 408576698