Add serialization of typenode for null/undefined/never as part of metadata type#13034
Merged
Conversation
mhegazy
suggested changes
Dec 19, 2016
| { | ||
| const unionOrIntersection = <UnionOrIntersectionTypeNode>node; | ||
| let serializedUnion: Identifier; | ||
| let serializedUnion: Identifier | VoidExpression; |
Contributor
There was a problem hiding this comment.
We should make the serializeType* family strongly typed when it comes to return value. today it returns Expression
| if (serializedUnion && serializedUnion.text !== serializedIndividual.text) { | ||
| serializedUnion = serializedIndividual; | ||
| } | ||
| else if (isVoidExpression(serializedIndividual)) { |
Contributor
There was a problem hiding this comment.
it could also return BinaryExpression would that be fine?
Member
Author
|
@mhegazy Please take a look, I have handled "non identifier" serialized expressions with null/undefined/never in the update. |
Contributor
|
@sheetalkamat does this handel #13098 as well? |
mhegazy
reviewed
Dec 21, 2016
| } | ||
| } | ||
|
|
||
| type SerializedEntityNameAsExpression = Identifier | BinaryExpression | PropertyAccessExpression; |
Contributor
There was a problem hiding this comment.
nit, can you move this next to the other type alias. possibly move both to the top of the file.
mhegazy
approved these changes
Dec 21, 2016
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #12684 and #11933