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
typeA=[number,number]typeB=[string,string]typeAB=A|Bfunctionfoo(...args:A): void/* works when removed */functionfoo(...args:B): void/* works when removed */functionfoo(...args:AB){}constargs=[1,2]asABfoo(...args)// A spread argument must either have a tuple type or be passed to a rest parameter.(2556)
π Actual behavior
Type Error:
A spread argument must either have a tuple type or be passed to a rest parameter.(2556)
π Expected behavior
No type errors. All resolutions of the AB union are valid tuples and should be spreadable.