-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Circular typedef references causes incorrect error #34809
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
From webpack: MultiCompiler.js and MultiWatching.js |
Doesn't repro anymore, but webpack still has the same failure. Looks like I need to fix the repro. |
I haven't got a repro but I've narrowed it down to a symbol-merging bug~~~~~! I knew we shouldn't have removed that assert in mergeSymbolTable. |
Looks like the first failure was on https://github.com/microsoft/TypeScript/pull/34718/files on 1:41 PM October 24. The run from October 23, 4:24 PM, does not have the failure. |
Looks like it was caused by #34712 |
Here's a standalone repro: {
"compilerOptions": {
"allowJs": true,
"checkJs": true,
"noEmit": true
}
} and // @Filename: MW.js
/** @typedef {import("./MC")} MC */
class MW {
/**
* @param {MC} compiler the compiler
*/
constructor(compiler) {
this.compiler = compiler;
}
}
module.exports = MW;
// @Filename: MC.js
const MW = require("./MW");
/** @typedef {number} Cictema */
module.exports = class MC {
watch() {
return new MW(this);
}
}; Gives the following compile error:
The error appears in the editor too. I'm not really sure what's different from the repro I posted originally. |
Expected: No error, or maybe a circular reference error somewhere.
Actual: Error on
@typedef {number} CompilerStatus
: "Duplicate identifier 'CompilerStatus'.".Bonus: in test.js, if you export
module.exports = {}
you get a stack overflow from the language service. I couldn't get this from the compiler, but I didn't try too hard.The text was updated successfully, but these errors were encountered: