dart-archive / ts2dart

ts2dart TypeScript to Dart transpiler
Apache License 2.0
181 stars 62 forks source link

Compile rest parameters to untyped Function objects #360

Closed mhevery closed 8 years ago

mhevery commented 8 years ago

Given:

method(fn: (..._: any[]) => Promise<any>| void,){...}

Expect:

method(Function fn){...}

Got Error:

Compile rest parameters to untyped Function objects
mprobst commented 8 years ago

The returned union type should get transformed into a dynamic /* ... */ comment, right?

I can take a look tomorrow, happy for somebody else to pick this up earlier if they have time.

mhevery commented 8 years ago

Correct

mprobst commented 8 years ago

I assume the fix you ask for is to de-generate all function parameters that have varargs/rest parameters into just Function.

I don't think you got that code as an error, what you should have gotten is: rest parameters are unsupported. It'd be nice if you could write up the actual error you get, that'd be a lot less puzzling :-)

mhevery commented 8 years ago

Sorry. Yes it throws Compile rest parameters to untyped Function objects

mhevery commented 8 years ago

thank you.