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
This is working as intended and is not a regression. We infer type number[] for nums and therefore we have to assume that the array may have as few as zero elements. It would be nice to infer a tuple type, but the reality is that arrays are mutable (the only thing that is const in the example is the array reference--the contents of the array are not). There are many similar issues already logged, e.g. #28336, #20899, #16389, #3369.
TypeScript Version: 3.2.1
Search Terms: spread, arguments
Code
Expected behavior:
the snippet above should compile without error
Actual behavior:
Error TS2556: Expected 4 arguments, but got 0 or more
The text was updated successfully, but these errors were encountered: