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
letx=[["a",[1]]];functionf(arg: [string,number[]][]){}f(x);// If I declare x's type directly like this then it works:// let x: [string, number[]][] = [["a", [1]]];
Expected behavior:
No error
Actual behavior:
Error:
Error:(352, 3) TS2345: Argument of type '(string | number[])[][]' is not assignable to parameter of type '[string, number[]][]'.
Type '(string | number[])[]' is not assignable to type '[string, number[]]'.
Property '0' is missing in type '(string | number[])[]'.
TypeScript Version: 3.1.6
Search Terms:
array tuple inference inferred argument
Code
Expected behavior:
No error
Actual behavior:
Error:
Playground Link:
Link
The text was updated successfully, but these errors were encountered: