| Index: pkg/compiler/lib/src/cps_ir/cps_ir_builder_visitor.dart
|
| diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_builder_visitor.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_builder_visitor.dart
|
| index fd1f21d09bde30b70c2ea1006da5416c718943dc..1ee1b802bb4d260d0cf6f62d0baa55d7964a6ea1 100644
|
| --- a/pkg/compiler/lib/src/cps_ir/cps_ir_builder_visitor.dart
|
| +++ b/pkg/compiler/lib/src/cps_ir/cps_ir_builder_visitor.dart
|
| @@ -857,14 +857,15 @@ abstract class IrBuilderVisitor extends ResolvedVisitor<ir.Primitive>
|
|
|
| DartType type = elements.getTypeLiteralType(node);
|
| if (type is TypeVariableType) {
|
| - ir.Primitive prim = new ir.ReifyTypeVar(type.element);
|
| - irBuilder.add(new ir.LetPrim(prim));
|
| - return prim;
|
| + return buildReifyTypeVariable(irBuilder.buildThis(), type);
|
| } else {
|
| return translateConstant(node);
|
| }
|
| }
|
|
|
| + ir.Primitive buildReifyTypeVariable(ir.Primitive target,
|
| + TypeVariableType variable);
|
| +
|
| ir.Primitive visitSendSet(ast.SendSet node) {
|
| assert(irBuilder.isOpen);
|
| Element element = elements[node];
|
| @@ -1278,6 +1279,15 @@ class DartIrBuilderVisitor extends IrBuilderVisitor {
|
| List<ir.Primitive> arguments) {
|
| return arguments;
|
| }
|
| +
|
| + @override
|
| + ir.Primitive buildReifyTypeVariable(ir.Primitive target,
|
| + TypeVariableType variable) {
|
| + assert(target is ir.This);
|
| + ir.Primitive prim = new ir.ReifyTypeVar(variable.element);
|
| + irBuilder.add(new ir.LetPrim(prim));
|
| + return prim;
|
| + }
|
| }
|
|
|
| /// IR builder specific to the JavaScript backend, coupled to the [JsIrBuilder].
|
| @@ -1803,6 +1813,16 @@ class JsIrBuilderVisitor extends IrBuilderVisitor {
|
| }
|
| return result;
|
| }
|
| +
|
| + @override
|
| + ir.Primitive buildReifyTypeVariable(ir.Primitive target,
|
| + TypeVariableType variable) {
|
| + ir.Primitive typeArgument = new ir.ReadTypeVariable(variable, target);
|
| + irBuilder.add(new ir.LetPrim(typeArgument));
|
| + ir.Primitive type = new ir.ReifyRuntimeType(typeArgument);
|
| + irBuilder.add(new ir.LetPrim(type));
|
| + return type;
|
| + }
|
| }
|
|
|
| /// Interface for generating [SourceInformation] for the CPS.
|
|
|