Type [x, x]
is not assignable to type x[] & { length: 2; }
#44508
Labels
[x, x]
is not assignable to type x[] & { length: 2; }
#44508
Bug Report
This error is probably self-explanatory. Either this is supposed to work and it’s a bug, or I’m misunderstanding something in which case please feel free to close.
Outer function is typed to return the latter. It calls an inner function, typed to return the former. One would assume this should work.
Possibly related: #44309
🔎 Search Terms
array literal length
🕗 Version & Regression Information
TypeScript 4.1.3
💻 Code
🙁 Actual behavior
The error as described above.
🙂 Expected behavior
No type error.
The text was updated successfully, but these errors were encountered: