Skip to content

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

Merged
merged 4 commits into from
Nov 19, 2015
Merged

Additional Types cleanup #5719

merged 4 commits into from
Nov 19, 2015

Conversation

rbuckton
Copy link
Contributor

  • Adds a new ThisType syntax kind, which will be needed by tree transforms to disambiguate this in a type position from this in an expression position.
  • Adds minimal support for this types in conjunction with --emitDecoratorMetadata. It now prints "Object" rather than crashing the compiler with a debug assertion.
    • NOTE: This will probably change from "Object" to at least the class constructor for the method after we fix circular reference issues with decorator metadata.

Supports #5595.

@mhegazy
Copy link
Contributor

mhegazy commented Nov 19, 2015

👍

@DanielRosenwasser DanielRosenwasser added Breaking Change Would introduce errors in existing code and removed Breaking Change Would introduce errors in existing code labels Nov 19, 2015
@@ -726,6 +727,7 @@ namespace ts {
// @kind(SyntaxKind.StringKeyword)
// @kind(SyntaxKind.SymbolKeyword)
// @kind(SyntaxKind.VoidKeyword)
// @kind(SyntaxKind.ThisType)
Copy link
Member

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?

Copy link
Member

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?

Copy link
Contributor Author

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.

@sandersn
Copy link
Member

👍

rbuckton added a commit that referenced this pull request Nov 19, 2015
@rbuckton rbuckton merged commit 7d6100b into master Nov 19, 2015
@rbuckton rbuckton deleted the typesCleanup2 branch November 19, 2015 23:32
@rbuckton rbuckton changed the title Types cleanup2 Additional Types cleanup Nov 25, 2015
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants