Skip to content

regression: Private fields appear in type literal in declarations (5.9) #62153

Description

🔎 Search Terms

private declaration

🕗 Version & Regression Information

  • This changed between versions 5.8 and 5.9

⏯ Playground Link

Playground Link

💻 Code

exportconstClassExpression=class{
#context =0};

🙁 Actual behavior

Declaration file contains invalid syntax

exportdeclareconstClassExpression: {new(): {
#context: number;};};

🙂 Expected behavior

5.8 output is also incorrect but at least syntactically valid

exportdeclareconstClassExpression: {new(): {"__#1@#context": number;};};

Additional information about the issue

No response

Metadata

Metadata

Labels

BugA bug in TypeScript

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions