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
functionf(...things: any[]){let[a, ...bs]=things;// do things with 'a' and 'bs'}functiong(xs: any[]){f(...xs);}
However, it might be the case that you want to be clear about how things will be used when your function gets called, so it should be fine to use an optional parameter for a:
functionf(a?: any, ...bs: any[]){// do things with 'a' and 'bs'}functiong(xs: any[]){f(...xs);// ~~~~~~~~}
Currently, with the invocation of f above you'll get the error message Supplied parameters do not match any signature of call target. even though a is optional.
The text was updated successfully, but these errors were encountered:
mhegazy
added
Fixed
A PR has been merged for this issue
and removed
Needs Proposal
This issue needs a plan that clarifies the finer details of how it could be implemented.
labels
Aug 31, 2017
@mhegazy@DanielRosenwasser using "typescript": "^2.7.0-dev.20171123" I am still having this issue everywhere I use spread operator I have to actually do functioName.call(null, value)
I am confused because most of the tickets said close but this still happening
Adapted from #4755.
Currently the following is fine:
However, it might be the case that you want to be clear about how
things
will be used when your function gets called, so it should be fine to use an optional parameter fora
:Currently, with the invocation of
f
above you'll get the error messageSupplied parameters do not match any signature of call target.
even thougha
is optional.The text was updated successfully, but these errors were encountered: