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

Add support for in narrowing #37858

Closed
wants to merge 3 commits into from
Closed

Conversation

Kingwl
Copy link
Contributor

@Kingwl Kingwl commented Apr 9, 2020

Fixes #21732

This or add existed key narrowing by in operator according #31132 by Generate an intersection with { a: unknown }.

@Kingwl
Copy link
Contributor Author

Kingwl commented Apr 9, 2020

Some problems:

  1. Should we narrow it if distribution failed?
  2. If so, should we narrow it if any member of the union is undefined/null/number?

@Kingwl Kingwl closed this Aug 3, 2020
@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label Aug 3, 2020
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
None yet
Development

Successfully merging this pull request may close these issues.

Suggestion: treat in operator as type guard which asserts property existence
2 participants