Skip to content

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

@dragomirtitian

Description

@dragomirtitian

🔎 Search Terms

private declaration

🕗 Version & Regression Information

  • This changed between versions 5.8 and 5.9

⏯ Playground Link

Playground Link

💻 Code

export const ClassExpression = class {
    #context = 0
};

🙁 Actual behavior

Declaration file contains invalid syntax

export declare const ClassExpression: {
    new (): {
        #context: number;
    };
};

🙂 Expected behavior

5.8 output is also incorrect but at least syntactically valid

export declare const ClassExpression: {
    new (): {
        "__#1@#context": number;
    };
};

Additional information about the issue

No response

Metadata

Metadata

Labels

BugA bug in TypeScript

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions