Crash observed in 4.8.x when a doc comment contains an @override before a {@link}
Bug Report
Crash observed in 4.8.x when a doc comment contains an @override anywhere before a {@link}. It does not matter if the doc comment contains some text between the @override modifier and the {@link} tag. If the @override modifier is placed after the {@link} inline tag, it works fine.
🔎 Search Terms
- tsdoc override link 4.8
- comment override link 4.8
🕗 Version & Regression Information
Observed in version 4.8.2, 4.8.3, appears to be fixed in 4.9-dev (nightly).
- This is a crash
- This changed between versions 4.8.0-dev.20220606 and 4.8.0-dev.20220608
⏯ Playground Link
Playground link with relevant code
💻 Code
class A {
f(){}
}
class B extends A {
/**
* @override {@link A}
*/
f(){}
}
🙁 Actual behavior
No JS code emitted, locally (using 4.8.3) crashes with:
~/experiments/ts48bug/node_modules/typescript/lib/tsc.js:98438
throw e;
^
TypeError: Cannot read properties of undefined (reading 'kind')
at getCannotFindNameDiagnosticForName (~/experiments/ts48bug/node_modules/typescript/lib/tsc.js:58471:37)
at resolveEntityName (~/experiments/ts48bug/node_modules/typescript/lib/tsc.js:42351:133)
at resolveJSDocMemberName (~/experiments/ts48bug/node_modules/typescript/lib/tsc.js:73458:30)
at checkJSDocLinkLikeTag (~/experiments/ts48bug/node_modules/typescript/lib/tsc.js:69370:17)
at checkSourceElementWorker (~/experiments/ts48bug/node_modules/typescript/lib/tsc.js:72827:28)
at checkSourceElement (~/experiments/ts48bug/node_modules/typescript/lib/tsc.js:72726:17)
at ~/experiments/ts48bug/node_modules/typescript/lib/tsc.js:72925:25
at Object.forEach (~/experiments/ts48bug/node_modules/typescript/lib/tsc.js:124:30)
at checkJSDocCommentWorker (~/experiments/ts48bug/node_modules/typescript/lib/tsc.js:72923:20)
at ~/experiments/ts48bug/node_modules/typescript/lib/tsc.js:72735:21
🙂 Expected behavior
Should emit JS code.
Duplicate of https://github.com/microsoft/TypeScript/issues/50717
This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.