| 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 17794f9d6e79c8e6bddda99321484c5ffbf00220..c59029c55ed28e210f9e4a02b1db97481b48c87a 100644
|
| --- a/sdk/lib/_internal/compiler/implementation/dart_types.dart
|
| +++ b/sdk/lib/_internal/compiler/implementation/dart_types.dart
|
| @@ -485,14 +485,12 @@ class InterfaceType extends GenericType {
|
| DartType asInstanceOf(ClassElement other) {
|
| other = other.declaration;
|
| if (element == other) return this;
|
| - for (InterfaceType supertype in element.allSupertypes) {
|
| - ClassElement superclass = supertype.element;
|
| - if (superclass == other) {
|
| - Link<DartType> arguments = Types.substTypes(supertype.typeArguments,
|
| - typeArguments,
|
| - element.typeVariables);
|
| - return new InterfaceType(superclass, arguments);
|
| - }
|
| + InterfaceType supertype = element.asInstanceOf(other);
|
| + if (supertype != null) {
|
| + Link<DartType> arguments = Types.substTypes(supertype.typeArguments,
|
| + typeArguments,
|
| + element.typeVariables);
|
| + return new InterfaceType(supertype.element, arguments);
|
| }
|
| return null;
|
| }
|
|
|