Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Unified Diff: pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart

Issue 1179503002: dart2js cps: Handle type variables in factory constructors. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Type argument Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/co19/co19-dart2js.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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),
« no previous file with comments | « no previous file | tests/co19/co19-dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698