| Index: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticTypeWarningCodeTest.java
|
| diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticTypeWarningCodeTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticTypeWarningCodeTest.java
|
| index 0b599b906effd4f7aaf5c8a39b6b1a482407ab41..1c961ef05f87b94b034da4b99aa77118178cc6b8 100644
|
| --- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticTypeWarningCodeTest.java
|
| +++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticTypeWarningCodeTest.java
|
| @@ -806,6 +806,41 @@ public class StaticTypeWarningCodeTest extends ResolverTestCase {
|
| assertErrors(source, StaticTypeWarningCode.UNDEFINED_GETTER);
|
| }
|
|
|
| + public void test_typePromotion_if_extends_notMoreSpecific_dynamic() throws Exception {
|
| + Source source = addSource(createSource(//
|
| + "class V {}",
|
| + "class A<T> {}",
|
| + "class B<S> extends A<S> {",
|
| + " var b;",
|
| + "}",
|
| + "",
|
| + "main(A<V> p) {",
|
| + " if (p is B) {",
|
| + " p.b;",
|
| + " }",
|
| + "}"));
|
| + resolve(source);
|
| + assertErrors(source, StaticTypeWarningCode.UNDEFINED_GETTER);
|
| + }
|
| +
|
| + public void test_typePromotion_if_extends_notMoreSpecific_notMoreSpecificTypeArg()
|
| + throws Exception {
|
| + Source source = addSource(createSource(//
|
| + "class V {}",
|
| + "class A<T> {}",
|
| + "class B<S> extends A<S> {",
|
| + " var b;",
|
| + "}",
|
| + "",
|
| + "main(A<V> p) {",
|
| + " if (p is B<int>) {",
|
| + " p.b;",
|
| + " }",
|
| + "}"));
|
| + resolve(source);
|
| + assertErrors(source, StaticTypeWarningCode.UNDEFINED_GETTER);
|
| + }
|
| +
|
| public void test_typePromotion_if_hasAssignment_after() throws Exception {
|
| Source source = addSource(createSource(//
|
| "main(Object p) {",
|
| @@ -878,6 +913,40 @@ public class StaticTypeWarningCodeTest extends ResolverTestCase {
|
| assertErrors(source, StaticTypeWarningCode.UNDEFINED_GETTER);
|
| }
|
|
|
| + public void test_typePromotion_if_implements_notMoreSpecific_dynamic() throws Exception {
|
| + Source source = addSource(createSource(//
|
| + "class V {}",
|
| + "class A<T> {}",
|
| + "class B<S> implements A<S> {",
|
| + " var b;",
|
| + "}",
|
| + "",
|
| + "main(A<V> p) {",
|
| + " if (p is B) {",
|
| + " p.b;",
|
| + " }",
|
| + "}"));
|
| + resolve(source);
|
| + assertErrors(source, StaticTypeWarningCode.UNDEFINED_GETTER);
|
| + }
|
| +
|
| + public void test_typePromotion_if_with_notMoreSpecific_dynamic() throws Exception {
|
| + Source source = addSource(createSource(//
|
| + "class V {}",
|
| + "class A<T> {}",
|
| + "class B<S> extends Object with A<S> {",
|
| + " var b;",
|
| + "}",
|
| + "",
|
| + "main(A<V> p) {",
|
| + " if (p is B) {",
|
| + " p.b;",
|
| + " }",
|
| + "}"));
|
| + resolve(source);
|
| + assertErrors(source, StaticTypeWarningCode.UNDEFINED_GETTER);
|
| + }
|
| +
|
| public void test_undefinedGetter() throws Exception {
|
| Source source = addSource(createSource(//
|
| "class T {}",
|
|
|