Closed
Description
Bug Report
If we have invalid JSDoc like in the example below, we get a Debug Failure. Did not expect TypeLiteral to have an Identifier in its trivia
when calling service functions e.g. getSyntacticClassifications
on a span containing the bad jsdoc.
🔎 Search Terms
debug failure, Did not expect TypeLiteral to have an Identifier in its trivia
🕗 Version & Regression Information
Probably always.
This is a crash.
⏯ Playground Link
Playground link with relevant code
💻 Code
class I18n {
/**
* @param {{dot|fulltext}} [stringMode] - which mode our translation keys use
*/
constructor(options = {}) {}
}
The bad JSDoc is the part inside the param's type expression: {dot|fulltext}
.
🙁 Actual behavior
Crash:
| Error: Debug Failure. Did not expect TypeLiteral to have an Identifier in its trivia
| at addSyntheticNodes (C:\Users\gabrielaa\projects\tsserverfuzzer\node_modules\typescript\lib\tsserverlibrary.js:160370:30)
| at createSyntaxList (C:\Users\gabrielaa\projects\tsserverfuzzer\node_modules\typescript\lib\tsserverlibrary.js:160386:13)
| at processNodes (C:\Users\gabrielaa\projects\tsserverfuzzer\node_modules\typescript\lib\tsserverlibrary.js:160349:27)
| at visitNodes (C:\Users\gabrielaa\projects\tsserverfuzzer\node_modules\typescript\lib\tsserverlibrary.js:29926:24)
| at Object.forEachChild (C:\Users\gabrielaa\projects\tsserverfuzzer\node_modules\typescript\lib\tsserverlibrary.js:30066:24)
| at NodeObject.forEachChild (C:\Users\gabrielaa\projects\tsserverfuzzer\node_modules\typescript\lib\tsserverlibrary.js:160324:23)
| at createChildren (C:\Users\gabrielaa\projects\tsserverfuzzer\node_modules\typescript\lib\tsserverlibrary.js:160358:14)
| at NodeObject.getChildren (C:\Users\gabrielaa\projects\tsserverfuzzer\node_modules\typescript\lib\tsserverlibrary.js:160301:56)
| at processElement (C:\Users\gabrielaa\projects\tsserverfuzzer\node_modules\typescript\lib\tsserverlibrary.js:128482:47)
| at processElement (C:\Users\gabrielaa\projects\tsserverfuzzer\node_modules\typescript\lib\tsserverlibrary.js:128486:25)
🙂 Expected behavior
No crash.
Metadata
Metadata
Assignees
Labels
A bug in TypeScriptFor flagging bugs which are compiler or service crashes or unclean exits, rather than bad outputA PR has been opened for this issueDetected by an older crawler (aka "fuzzer") running random TSServer operations on public code.This issue was previously scheduled to an earlier milestone