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

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

Issue 10540079: Issue 3280. Fix for using function alias type as type variable bounds (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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
« no previous file with comments | « no previous file | compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 163e862baf401368ac7a14011c9c68218c1b73d6..83dfd691dab34e7ab91ba02de0aabe727d143eed 100644
--- a/compiler/java/com/google/dart/compiler/type/Types.java
+++ b/compiler/java/com/google/dart/compiler/type/Types.java
@@ -163,6 +163,13 @@ public class Types {
if (isSubtypeOfInterface(t, s)) {
return true;
}
+ if (t.getKind() == TypeKind.VARIABLE) {
+ Type bound = ((TypeVariable) t).getTypeVariableElement().getBound();
+ if (bound != null) {
+ return isSubtype(bound, s);
+ }
+ return true;
+ }
if (t.getKind().equals(TypeKind.FUNCTION_ALIAS)) {
return isSubtypeOfFunction(asFunctionType((FunctionAliasType) t), asFunctionType(s));
}
« no previous file with comments | « no previous file | compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698