Skip to content

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

Closed
@mjbvz

Description

@mjbvz

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

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScript

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions