TypeScript icon indicating copy to clipboard operation
TypeScript copied to clipboard

Crash observed in 4.8.x when a doc comment contains an @override before a {@link}

Open moisadoru opened this issue 3 years ago • 1 comments

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.

moisadoru avatar Sep 21 '22 20:09 moisadoru

Duplicate of https://github.com/microsoft/TypeScript/issues/50717

a-tarasyuk avatar Sep 21 '22 21:09 a-tarasyuk

This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.

typescript-bot avatar Sep 30 '22 18:09 typescript-bot