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

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions