Skip to content

Conversation

@ahejlsberg
Copy link
Member

This PR formalizes a stricter notion of what is considered a discriminant property. A property of a union type is considered a discriminant property if

  • the type of the property is not identical in each of the constituent types, and
  • the type of the property is a union of unit types.

Because a type guard for a discriminant property of a discriminated union object invalidates preceding type guards for other properties in the same object, it is important to reduce false positives when determining if a property is a discriminant.

Fixes #10169.

@RyanCavanaugh
Copy link
Member

👍

@ahejlsberg ahejlsberg merged commit f6a850b into master Aug 8, 2016
@ahejlsberg ahejlsberg deleted the discriminantPropertyCheck branch August 8, 2016 18:52
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 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.

4 participants