Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed narrowing types by aliased optional chain call expressions #59153

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Andarist
Copy link
Contributor

@Andarist Andarist commented Jul 5, 2024

fixes #59145

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Jul 5, 2024
Comment on lines +29300 to +29301
// Ordinarily we don't need to to this in control flow analysis because the Binder breaks this down.
// However, we may encounter the need to narrow this down here when analyzing aliased conditional expressions.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A need to do some extra narrowings when dealing with aliased conditions isn't new, see: https://github.dev/microsoft/TypeScript/blob/3163fe7e3898c1f48cd9bc097b96e3426cd2a453/src/compiler/checker.ts#L28886-L28888

@typescript-bot typescript-bot added For Backlog Bug PRs that fix a backlog bug and removed For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Jul 9, 2024
@sandersn
Copy link
Member

sandersn commented Jul 9, 2024

#59144 is related, at least in the general area it fixes.

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
4 participants