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

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

Issue 47923014: Issue 14364. Strengthen isDirectSupertypeOf() to check type parameters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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/NonErrorResolverTest.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java
index a62ab53783aac6bb143dc92eebaeee03572e59ca..08ea82202c5eef6075fbe18f5c4d62476f7d41ea 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonErrorResolverTest.java
@@ -3120,6 +3120,25 @@ public class NonErrorResolverTest extends ResolverTestCase {
verify(source);
}
+ public void test_typePromotion_if_extends_moreSpecific() throws Exception {
+ Source source = addSource(createSource(//
+ "class V {}",
+ "class VP extends V {}",
+ "class A<T> {}",
+ "class B<S> extends A<S> {",
+ " var b;",
+ "}",
+ "",
+ "main(A<V> p) {",
+ " if (p is B<VP>) {",
+ " p.b;",
+ " }",
+ "}"));
+ resolve(source);
+ assertNoErrors(source);
+ verify(source);
+ }
+
public void test_typePromotion_if_hasAssignment_outsideAfter() throws Exception {
Source source = addSource(createSource(//
"main(Object p) {",
@@ -3146,6 +3165,25 @@ public class NonErrorResolverTest extends ResolverTestCase {
verify(source);
}
+ public void test_typePromotion_if_implements_moreSpecific() throws Exception {
+ Source source = addSource(createSource(//
+ "class V {}",
+ "class VP extends V {}",
+ "class A<T> {}",
+ "class B<S> implements A<S> {",
+ " var b;",
+ "}",
+ "",
+ "main(A<V> p) {",
+ " if (p is B<VP>) {",
+ " p.b;",
+ " }",
+ "}"));
+ resolve(source);
+ assertNoErrors(source);
+ verify(source);
+ }
+
public void test_typePromotion_if_inClosure_assignedAfter_inSameFunction() throws Exception {
Source source = addSource(createSource(//
"main() {",

Powered by Google App Engine
This is Rietveld 408576698