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
searching for "refinement destructuring" brought up issue #35283 which is basically the same.
TypeScript cannot narrow a variable based on another variable's refinement.
TypeScript Version: 3.7 (tried nightly too)
Search Terms:
Code
Expected behavior:
I'd expected this to be refined regardless of whether testing the destructured discriminator or accessing it through the argument.
Actual behavior:
When destructuring the type is not refined.
Playground Link:
Playground
Related Issues:
The text was updated successfully, but these errors were encountered: