Skip to content

Conversation

@nekolab
Copy link

@nekolab nekolab commented Aug 25, 2024

This PR introduces a method to narrow the types of destructured variables through control flow analysis without relying on the discriminant member.

When the initializer of the ObjectBindingPattern is available, we attempt to narrow its type, which in turn helps further refine the type of the destructured variable.

Partially fixes #59657

This PR introduces a method to narrow the types of destructured
variables through control flow analysis without relying on the
discriminant member.

When the initializer of the `ObjectBindingPattern` is available,
we attempt to narrow its type, which in turn helps further refine
the type of the destructured variable.

Partially fixes microsoft#59657
@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label Aug 25, 2024
@nekolab
Copy link
Author

nekolab commented Aug 25, 2024

@microsoft-github-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

For Backlog Bug PRs that fix a backlog bug

Projects

Status: Not started

Development

Successfully merging this pull request may close these issues.

Make type narrowing for destructured discriminated unions work for more types

2 participants