-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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
Add serialization of typenode for null/undefined/never as part of metadata type #13034
Conversation
@@ -1715,27 +1717,35 @@ namespace ts { | |||
case SyntaxKind.UnionType: | |||
{ | |||
const unionOrIntersection = <UnionOrIntersectionTypeNode>node; | |||
let serializedUnion: Identifier; | |||
let serializedUnion: Identifier | VoidExpression; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it could also return BinaryExpression
would that be fine?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or ConditionalExpression
@mhegazy Please take a look, I have handled "non identifier" serialized expressions with null/undefined/never in the update. |
@sheetalkamat does this handel #13098 as well? |
@@ -1815,14 +1826,15 @@ namespace ts { | |||
} | |||
} | |||
|
|||
type SerializedEntityNameAsExpression = Identifier | BinaryExpression | PropertyAccessExpression; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, can you move this next to the other type alias. possibly move both to the top of the file.
Fixes #12684 and #11933