Index: lib/compiler/implementation/native_handler.dart |
diff --git a/lib/compiler/implementation/native_handler.dart b/lib/compiler/implementation/native_handler.dart |
index e2fcb00a32f6c13d356fcbb60235f0290fd7e196..6a3af490f90a8b403620e4aa4f84a4b32bd2c61f 100644 |
--- a/lib/compiler/implementation/native_handler.dart |
+++ b/lib/compiler/implementation/native_handler.dart |
@@ -245,9 +245,13 @@ void handleSsaNative(SsaBuilder builder, Expression nativeBody) { |
inputs.add(builder.localsHandler.readThis()); |
} |
parameters.forEachParameter((Element parameter) { |
- Type type = parameter.computeType(compiler); |
+ Type type = parameter.computeType(compiler).unalias(compiler); |
HInstruction input = builder.localsHandler.readLocal(parameter); |
- if (type is FunctionType) input = convertDartClosure(parameter, type); |
+ if (type is FunctionType) { |
+ // The parameter type is a function type either directly or through |
+ // typedef(s). |
+ input = convertDartClosure(parameter, type); |
ahe
2012/08/16 13:22:58
I suspect that we want to pass the unaliased type
Johnni Winther
2012/08/17 11:15:19
It seems that what is need is the arity, which imp
|
+ } |
inputs.add(input); |
arguments.add('#'); |
}); |
@@ -277,8 +281,10 @@ void handleSsaNative(SsaBuilder builder, Expression nativeBody) { |
// mangling problem will go away once we switch these libraries |
// to use Leg's 'JS' function. |
parameters.forEachParameter((Element parameter) { |
- Type type = parameter.computeType(compiler); |
+ Type type = parameter.computeType(compiler).unalias(compiler); |
if (type is FunctionType) { |
+ // The parameter type is a function type either directly or through |
+ // typedef(s). |
HInstruction jsClosure = convertDartClosure(parameter, type); |
// Because the JS code references the argument name directly, |
// we must keep the name and assign the JS closure to it. |