Skip to content

Conversation

weswigham
Copy link
Member

Fixes #23510

Switch-case exhaustiveness is still handled roughly the same way, however this removes the unit type restriction on switch-case narrowing (which brings it inline with if narrowing).

return !!getPropertyOfType(type, "0" as __String);
}

function isNotUnitTypeOrNever(type: Type): boolean {
Copy link
Member

Choose a reason for hiding this comment

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

Nit: isNeitherUnitTypeNorNever

Copy link
Member Author

Choose a reason for hiding this comment

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

But I don't use the neither/nor operator in the body. 👅

@weswigham weswigham merged commit 8c5ad24 into microsoft:master Apr 27, 2018
@weswigham weswigham deleted the relax-narrowing-restrictions branch April 27, 2018 23:30
@microsoft microsoft locked and limited conversation to collaborators Jul 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants