Index: pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart |
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart |
index 78b709b97a91f1efe842d2eaa4c1a1ac9d1760fb..c92471617d0b4cb2bf3e551e5baa3f1d08a71e5e 100644 |
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart |
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart |
@@ -2333,9 +2333,10 @@ class JsIrBuilder extends IrBuilder { |
} |
ir.Primitive buildTypeExpression(DartType type) { |
+ type = program.unaliasType(type); |
if (type is TypeVariableType) { |
return buildTypeVariableAccess(type); |
- } else if (type is InterfaceType) { |
+ } else if (type is InterfaceType || type is FunctionType) { |
List<ir.Primitive> arguments = <ir.Primitive>[]; |
type.forEachTypeVariable((TypeVariableType variable) { |
ir.Primitive value = buildTypeVariableAccess(variable); |
@@ -2397,6 +2398,8 @@ class JsIrBuilder extends IrBuilder { |
assert(isOpen); |
assert(isTypeTest != null); |
+ type = program.unaliasType(type); |
+ |
if (type.isMalformed) { |
FunctionElement helper = program.throwTypeErrorHelper; |
ErroneousElement element = type.element; |
@@ -2412,6 +2415,8 @@ class JsIrBuilder extends IrBuilder { |
typeArguments = type.typeArguments.map(buildTypeExpression).toList(); |
} else if (type is TypeVariableType) { |
typeArguments = <ir.Primitive>[buildTypeVariableAccess(type)]; |
+ } else if (type is FunctionType) { |
+ typeArguments = <ir.Primitive>[buildTypeExpression(type)]; |
} |
if (isTypeTest) { |