Closed sandersn closed 5 years ago
@weswigham I'm assigning to you because I'm pretty sure this is a result of https://github.com/microsoft/TypeScript/pull/32947. If it's actually a result of contructor-functions-as-classes, re-assign to me.
@sandersn this was broken in TS 3.5, too (and probably stretches back even farther)~
On inspection, yeah - also broken in 3.1.
It's a duplicate of commonjs-exports-should-be-aliases, #25533, although this is a particularly good example of it.
TypeScript Version: 3.4.0-dev.201xxxxx
Search Terms:
Code
Run this:
Have a tsconfig like this:
In mod1.js:
In welove.ts:
Expected behavior: type reference and value reference to
Worker
refer to the class defined inmod1.js
.Actual behavior: type reference
Worker
refers to the one in lib.dom.d.ts.Two variants:
export { Worker }
, the error goes away.module.exports.Worker = class Worker extends EventEmitter
, the error goes away, but goto-def on the value Worker throws an assertion: