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

Unified Diff: compiler/java/com/google/dart/compiler/type/Types.java

Issue 12799003: Fix warning work arounded in 12787002. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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: compiler/java/com/google/dart/compiler/type/Types.java
diff --git a/compiler/java/com/google/dart/compiler/type/Types.java b/compiler/java/com/google/dart/compiler/type/Types.java
index 44f401e282e6f357ddcd93d9b9dbb679aa290622..8e83daf9a3bd62d52752853f8f0741ede31b9d9e 100644
--- a/compiler/java/com/google/dart/compiler/type/Types.java
+++ b/compiler/java/com/google/dart/compiler/type/Types.java
@@ -344,6 +344,21 @@ public class Types {
return isSubtype(tBound, sv);
}
}
+ // May be concrete InterfaceType.
+ if (t.getKind() == TypeKind.INTERFACE) {
+ InterfaceType ti = (InterfaceType) t;
+ Type sBound = sv.getTypeVariableElement().getBound();
+ if (sBound == null) {
+ return true;
+ }
+ // Prevent cycle.
+ if (sBound.equals(sv)) {
+ return false;
+ }
+ if (sBound.getKind() == TypeKind.INTERFACE) {
+ return isSubtype(ti, sBound);
+ }
+ }
// no
return false;
}

Powered by Google App Engine
This is Rietveld 408576698