Skip to content

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

@sandersn sandersn requested review from gabritto and rbuckton July 9, 2024 22:18
@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

Projects

Status: Waiting on reviewers

Development

Successfully merging this pull request may close these issues.

Aliased optional chain calls don't narrow like their inline equivalents

4 participants