Index: pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart |
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart |
index e768e3c154fb4a360fa86d4107f252acbaad1b38..1ab44e7146e0fd59f4417f5c15b9484bb12c4b25 100644 |
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart |
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart |
@@ -192,8 +192,15 @@ abstract class IrBuilderVisitor extends ast.Visitor<ir.Primitive> |
ir.FunctionDefinition _makeFunctionBody(FunctionElement element, |
ast.FunctionExpression node) { |
FunctionSignature signature = element.functionSignature; |
- List<ParameterElement> parameters = []; |
- signature.orderedForEachParameter(parameters.add); |
+ List<Local> parameters = <Local>[]; |
+ signature.orderedForEachParameter((e) => parameters.add(e)); |
+ |
+ if (element.isFactoryConstructor) { |
+ // Type arguments are passed in as extra parameters. |
+ for (DartType typeVariable in element.enclosingClass.typeVariables) { |
+ parameters.add(new TypeVariableLocal(typeVariable, element)); |
+ } |
+ } |
irBuilder.buildFunctionHeader(parameters, |
closureScope: getClosureScopeForNode(node), |