Skip to content

Renaming class name switches up order in object literal shorthand #32341

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

Closed
mjbvz opened this issue Jul 11, 2019 · 0 comments · Fixed by #38541
Closed

Renaming class name switches up order in object literal shorthand #32341

mjbvz opened this issue Jul 11, 2019 · 0 comments · Fixed by #38541
Assignees
Labels
Bug A bug in TypeScript

Comments

@mjbvz
Copy link
Contributor

mjbvz commented Jul 11, 2019

From microsoft/vscode#76482

TypeScript Version: 3.6.0-dev.20190710

Search Terms:

  • rename
  • object literal
  • alias

Code

For the JS:

class A { }
module.export = { A };
  1. Rename A in class A {}

Expected behavior:

class B { }
module.export = { A: B };

Actual behavior:

class B { }
module.export = { B: A };

The order in the exported object literal is swapped so we end up referencing A which no longer exists

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants