| Index: sdk/lib/_internal/compiler/implementation/typechecker.dart
|
| diff --git a/sdk/lib/_internal/compiler/implementation/typechecker.dart b/sdk/lib/_internal/compiler/implementation/typechecker.dart
|
| index 5dd026aa6ed882f957bd4466555d31f034784265..ff499fc4548274054087a5d8e703feb0980490af 100644
|
| --- a/sdk/lib/_internal/compiler/implementation/typechecker.dart
|
| +++ b/sdk/lib/_internal/compiler/implementation/typechecker.dart
|
| @@ -1334,10 +1334,19 @@ class TypeCheckerVisitor extends Visitor<DartType> {
|
| if (Elements.isUnresolved(constructor)) return types.dynamicType;
|
| DartType constructorType = constructor.computeType(compiler);
|
| if (identical(type.kind, TypeKind.INTERFACE)) {
|
| - InterfaceType interfaceType = type;
|
| - constructorType = constructorType.subst(
|
| - interfaceType.typeArguments,
|
| - interfaceType.element.typeVariables);
|
| + if (constructor.isSynthesized) {
|
| + // TODO(johnniwinther): Remove this when synthesized constructors handle
|
| + // type variables correctly.
|
| + InterfaceType interfaceType = type;
|
| + ClassElement receiverElement = interfaceType.element;
|
| + while (receiverElement.isMixinApplication) {
|
| + receiverElement = receiverElement.supertype.element;
|
| + }
|
| + constructorType = constructorType.substByContext(
|
| + interfaceType.asInstanceOf(receiverElement));
|
| + } else {
|
| + constructorType = constructorType.substByContext(type);
|
| + }
|
| }
|
| return constructorType;
|
| }
|
|
|