Closed
Description
// @Filename: module.js
/** @typedef {number} Num */
module.exports = { a: 1 }
// @Filename: use.js
/** @type {import("./module.js").Num} */
var n;
Expected:
Num is visible in use.js
Actual:
Num is not visible.
Note that the checker already has code to handle structures like this, so modules with modules.exports=
should already almost work. Other kinds of modules may or may not.
The special-case merge code for module.exports=
in the checker puts SymbolFlags.Value on all the symbols, which will be incorrect for this case, so that code will need to be updated.