| Index: pkg/compiler/lib/src/resolution/resolution_strategy.dart
|
| diff --git a/pkg/compiler/lib/src/resolution/resolution_strategy.dart b/pkg/compiler/lib/src/resolution/resolution_strategy.dart
|
| index 98222e2b3d4407b423c6b27e680af21a11fc1b34..a73a07ed2393b18e05197692a6d3b35f50282f35 100644
|
| --- a/pkg/compiler/lib/src/resolution/resolution_strategy.dart
|
| +++ b/pkg/compiler/lib/src/resolution/resolution_strategy.dart
|
| @@ -648,7 +648,20 @@ class _CompilerElementEnvironment implements ElementEnvironment {
|
| return method.constructor.type;
|
| }
|
| method.computeType(_resolution);
|
| - return method.type;
|
| + ResolutionFunctionType type = method.type;
|
| + if (method.isConstructor) {
|
| + ConstructorElement constructor = method;
|
| + if (constructor.definingConstructor != null) {
|
| + // The type of a defining constructor doesn't use the right type
|
| + // variables. Substitute the type variable of the defining class by the
|
| + // type variables of the enclosing class.
|
| + ClassElement definingClass =
|
| + constructor.definingConstructor.enclosingClass;
|
| + type = type.substByContext(
|
| + method.enclosingClass.thisType.asInstanceOf(definingClass));
|
| + }
|
| + }
|
| + return type;
|
| }
|
|
|
| @override
|
|
|