You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected behavior:
Function 1, 2 and 3 should all transpile. The equivalent code in ES6 JavaScript will run fine.
Actual behavior:
There are errors in functions 1 and 2 complaining that the supplied parameters do not match the signature of the call target. Function 3 is similar in behaviour and transpiles without error.
In this case, TypeScript knows the contents of the array being spread so should be able to know if the values within the array match the signature of the call target. And in cases where the contents are unknown, it should either transpile (with a possible warning), or possible a clearer error message given
The text was updated successfully, but these errors were encountered:
In this case yes, however this is just a demonstration of the problem. I came across this problem though when using a third party component. The signature of the target function I wanted to call was: dropEvent(eventObject: FullCalendar.EventObject, delta: moment.Duration, revertFunc: Function, jsEvent: Event, ui: any, view: FullCalendar.ViewObject)
These happened to be exactly the same as what I already had in arguments so attempted to call dropEvent(...arguments);
Overloading is only a reasonable answer when you are the author of the target function, all of the arguments are of the similar type and it makes sense in that context.
TypeScript Version: 2.2.1
Code
Expected behavior:
Function 1, 2 and 3 should all transpile. The equivalent code in ES6 JavaScript will run fine.
Actual behavior:
There are errors in functions 1 and 2 complaining that the supplied parameters do not match the signature of the call target. Function 3 is similar in behaviour and transpiles without error.
In this case, TypeScript knows the contents of the array being spread so should be able to know if the values within the array match the signature of the call target. And in cases where the contents are unknown, it should either transpile (with a possible warning), or possible a clearer error message given
The text was updated successfully, but these errors were encountered: