Skip to content

JS declarations for an export assigned class expression can conflict with local names #33626

Description

Per this comment on the PR, the JS declaration emitter currently has a known issue where an export assigned class expression with a name can cause a conflict with another named declaration in the file and produce an invalid declaration file.

So, for example, this:

classA{member=newQ();};classQ{x=12};module.exports=classQ{x=newA();}

currently emits along the lines of

declareclassA{member: Q;};declareclassQ{x: number};declareclassQ{x: A;}exports=Q;

(because it reused the anonymous class's name for the hoisted class declaration) which isn't quite right.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugA bug in TypeScriptDomain: Declaration EmitThe issue relates to the emission of d.ts files

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions