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

Recreate old less safe for loop behavior #18262

Closed

Conversation

weswigham
Copy link
Member

@weswigham weswigham commented Sep 5, 2017

Our behavior changed with #17404 to disallow doing for..in on unions containing type variables (which we have allowed in the past, despite its lack of extra safety). With this change we allow it once more, by introducing a propagating flag which tracks the presence of a type variable. Technically, only unions and intersections needed to be special-cased (as anywhere else the flag is propagated will be caught by the NonPrimitive assignability check), but I feel the flag is much cleaner than specializing isTypeAssignableToKind.
Fixes #18203.

@typescript-bot
Copy link
Collaborator

Thanks for your contribution. This PR has not been updated in a while and cannot be automatically merged at the time being. For housekeeping purposes we are closing stale PRs. If you'd still like to continue working on this PR, please leave a message and one of the maintainers can reopen it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants