| 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(//
|
|
|