| Index: pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart
|
| diff --git a/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart b/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart
|
| index 3c85ff073254ae904a1e80ac34864caacfd91184..9bc53bd6bff3d5b58d98b84bec5bf3d048c5cfd9 100644
|
| --- a/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart
|
| +++ b/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart
|
| @@ -747,9 +747,14 @@ class DartTypeConverter extends ir.DartTypeVisitor<DartType> {
|
| } else if (node.parameter.parent is ir.FunctionNode) {
|
| ir.FunctionNode func = node.parameter.parent;
|
| int index = func.typeParameters.indexOf(node.parameter);
|
| - ConstructorElement constructorElement = astAdapter.getElement(func);
|
| - ClassElement classElement = constructorElement.enclosingClass;
|
| - return classElement.typeVariables[index];
|
| + Element element = astAdapter.getElement(func);
|
| + if (element.isConstructor) {
|
| + ClassElement classElement = element.enclosingClass;
|
| + return classElement.typeVariables[index];
|
| + } else {
|
| + GenericElement genericElement = element;
|
| + return genericElement.typeVariables[index];
|
| + }
|
| }
|
| throw new UnsupportedError('Unsupported type parameter type node $node.');
|
| }
|
|
|