Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upCorrect handling of union types in expressions #1765
Conversation
ahejlsberg
added some commits
Jan 19, 2015
This comment has been minimized.
This comment has been minimized.
|
Maybe isTypeOrUnionOfKind? Not a big deal though |
This comment has been minimized.
This comment has been minimized.
ahejlsberg
added a commit
that referenced
this pull request
Jan 21, 2015
ahejlsberg
merged commit 2052ac3
into
master
Jan 21, 2015
1 check passed
continuous-integration/travis-ci
The Travis CI build passed
Details
ahejlsberg
deleted the
unionTypeOperations
branch
Jan 21, 2015
microsoft
locked and limited conversation to collaborators
Jun 18, 2018
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
ahejlsberg commentedJan 21, 2015
Fixes #1715 (and others like it).
This PR corrects our handling of union types for certain expression operators. Specifically, where operators support operands of certain kinds of types we now also support unions of those kinds of types. For example, in an index access
a[x]we now allowxto be a union type such asstring | numberorEnum1 | Enum2, and in an arithmetic operation such asx * ywe allow the operands to be unions composed of enum types.