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
Thanks for the quick reply! Adding a new overload solved the problem for me.
Would you consider The implementation signature is not considered part of the overloads for the method intended or bug? It feels counter intuitive that I have to explicitly declare a new overload even though I have an implementation already.
Having the exposed overloads separate from the implementation allows to expose nice and cleanly typed overloads while having an ugly internal implementation signature that just exists to match all the “official” function signatures.
So definitely a feature IMO
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed.
TypeScript Version: 2.9.0-dev.20180422
Search Terms: spread, overload
Code
Expected behavior:
No Errors.
Actual behavior:
error TS2556: Expected 0 arguments, but got 1 or more.
If I just swap the order of the declarations of function foo it works.
Playground Link:
https://www.typescriptlang.org/play/#src=function%20foo()%3A%20void%3B%0D%0Afunction%20foo(...args%3A%20%7B%7D%5B%5D)%3A%20void%20%7B%7D%0D%0Afunction%20bar(...args%3A%20%7B%7D%5B%5D)%20%7B%0D%0A%20%20foo(...args)%3B%0D%0A%7D
Related Issues:
#20071 is the fix for excess spread operator check.
#21906 is very close to my issue, but not quite the same.
The text was updated successfully, but these errors were encountered: