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

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: Fix status 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..f0c02234133b3e0407f9e0b0acd78d1aeac6da39 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 = [];
karlklose 2015/06/10 12:55:22 Add type argument.
asgerf 2015/06/10 13:01:17 Done.
+ signature.orderedForEachParameter((e) => parameters.add(e));
karlklose 2015/06/10 12:55:22 Is this because of type warnings?
asgerf 2015/06/10 13:01:17 Yup. :(
+
+ 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