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

Optional chaining control flow refinements missing #34570

Closed
ahejlsberg opened this issue Oct 18, 2019 · 0 comments · Fixed by #34597
Closed

Optional chaining control flow refinements missing #34570

ahejlsberg opened this issue Oct 18, 2019 · 0 comments · Fixed by #34597
Assignees
Labels
Bug A bug in TypeScript Fix Available A PR has been opened for this issue

Comments

@ahejlsberg
Copy link
Member

TypeScript Version: 3.7.x-dev.20191017

Code

In the comments on #33736, several issues related to control flow analysis of optional chaining constructs are mentioned. Specifically:

#33736 (comment) -- No narrowing in switch statement.
#33736 (comment) -- No narrowing following assertion.
#33736 (comment) -- No narrowing in false branch of if statement.

Expected behavior:

Proper narrowing as indicated in the examples.

Actual behavior:

No narrowing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Fix Available A PR has been opened for this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant