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
However, when I do the same with a tuple returned by a function, their “literalness” is preserved only when the values are read using the square bracket notation:
TypeScript Version: 3.9.0-dev.20200315
Search Terms:
Expected behavior:
When destructuring a tuple of array literals, destructured elements should preserve literal values.
Actual behavior:
Destructured elements are not literals.
Related Issues:
Code
If I create a tuple of literals:
the accessed elements are also literals; regardless of whether I destructure them inline or read them in separate lines. That's good.
However, when I do the same with a tuple returned by a function, their “literalness” is preserved only when the values are read using the square bracket notation:
but not when the assignment happens via destructuring:
Output
Compiler Options
Playground Link: Provided
The text was updated successfully, but these errors were encountered: