-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Additional Types cleanup #5719
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Additional Types cleanup #5719
Conversation
…on and a 'this' type. Needed for transforms
… 'Object' for now.
👍 |
@@ -726,6 +727,7 @@ namespace ts { | |||
// @kind(SyntaxKind.StringKeyword) | |||
// @kind(SyntaxKind.SymbolKeyword) | |||
// @kind(SyntaxKind.VoidKeyword) | |||
// @kind(SyntaxKind.ThisType) |
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.
What about string literal types?
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.
I think there would need to be a StringLiteralType
kind and a StringLiteral
kind, just like how there's ThisType
and ThisKeyword
. So maybe a followup PR?
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.
@DanielRosenwasser, @weswigham: I primarily need this to disambiguate this
during tree transformations. I have no such need for disambiguation for string literal types. I may have a follow-up PR for this at some point to achieve consistency, but its not as high of a priority.
👍 |
ThisType
syntax kind, which will be needed by tree transforms to disambiguatethis
in a type position fromthis
in an expression position.this
types in conjunction with--emitDecoratorMetadata
. It now prints "Object" rather than crashing the compiler with a debug assertion.Supports #5595.