Chromium Code Reviews| Index: sdk/lib/_internal/compiler/implementation/dart_types.dart |
| diff --git a/sdk/lib/_internal/compiler/implementation/dart_types.dart b/sdk/lib/_internal/compiler/implementation/dart_types.dart |
| index 8f209240b8ec5101e4b2b1dce44466973471d422..6705302c045ab3e5330f6db4fd94e2f1e2d429b8 100644 |
| --- a/sdk/lib/_internal/compiler/implementation/dart_types.dart |
| +++ b/sdk/lib/_internal/compiler/implementation/dart_types.dart |
| @@ -122,6 +122,8 @@ class TypeVariableType extends DartType { |
| TypeVariableType(this.element); |
| + DartType get upperBound => element.upperBound; |
| + |
| TypeKind get kind => TypeKind.TYPE_VARIABLE; |
| SourceString get name => element.name; |
| @@ -788,8 +790,9 @@ class Types { |
| } |
| return true; |
| } else if (t is TypeVariableType) { |
| - if (s is !TypeVariableType) return false; |
| - return (identical(t.element, s.element)); |
| + if (t == s) return true; |
| + TypeVariableType typeVariable = t; |
| + return isSubtype(typeVariable.upperBound, s); |
|
ahe
2013/02/05 15:14:40
How do you deal with:
class Foo<T extends S, S ex
Johnni Winther
2013/02/05 18:45:57
I don't. I think this should be part of the (still
ahe
2013/02/18 08:22:18
I don't like having known unbounded recursion in a
|
| } else { |
| throw 'internal error: unknown type kind'; |
| } |