Closed
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:
class A { member = new Q(); };
class Q { x = 12 };
module.exports = class Q { x = new A(); }
currently emits along the lines of
declare class A { member: Q; };
declare class Q { x: number };
declare class Q { x: A; }
exports = Q;
(because it reused the anonymous class's name for the hoisted class declaration) which isn't quite right.