-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
JSDOC @type tag crashes with simple export #36830
Comments
Cool, reproduced with: // @allowJs: true
// @noEmit: true
// @checkJs: true
// @filename: lib/index.js
/** @type {import('../folder/index').zzz} */
function xxx() {
return null;
}
// @filename: folder/index.d.ts
export function zzz(): string; In normal TypeScript code, you wouldn't write Which I think leads to another question, what should be the behavior here in JSDoc world? Do we assume we want the |
Asked around, and the opinion is yes - we want to pretend there's a |
Using import("assert").strict appears to cause TypeScript to enter an infinite loop. This prevented type checking from working properly in the test suite. Workaround: Add 'typeof' at the beginning of the @type annotation. Possibly related issue: microsoft/TypeScript#36830
A fix for this got merged yesterday: #39770 |
TypeScript Version: 3.9.0-dev.20200215 (also tested 3.7.5)
(the last one that doesn't crash is
v3.7.1-rc
.v3.7.2
crashes)Search Terms:
Maximum call stack size exceeded
getTypeOfFuncClassEnumModule
Code
/lib/index.js
:/types/index.d.ts
:/tsconfig.json
:Expected behavior:
No crash.
Typescript error about function returning wrong error type.
Actual behavior:
Crash.
Playground Link:
https://github.com/rchl/ts-crash-test
Related Issues:
The text was updated successfully, but these errors were encountered: