TypeScript Version: 4.1.2
Search Terms: JSDoc, extends
If a detached JSDoc class docstring which uses @extends is placed in a .js file, tsc will crash. This does not happen when the @extends tag is not present.
Code
widget.js
class Widget {
constructor() {
}
}
/**
* @class SpecialWidget
* @extends Widget
*
* This class exposes a Special widget.
*/
/**
* @constructor
*
* Create a `specialWidget`.
*/
class SpecialWidget extends Widget {
constructor() {
}
}
export default SpecialWidget;
tsc command
$ tsc widget.js --allowJs --outDir out
Exepected behavior:
Even though the docstring for the constructor is misplaced, this should not cause tsc to fail.
Actual behavior:
$ tsc widget.js --allowJs --outDir out
C:\Users\Juda-OzbayEmilia\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:87001
throw e;
^
Error: Debug Failure. False expression.
at checkJSDocAugmentsTag (C:\Users\Juda-OzbayEmilia\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:61428:22)
at checkSourceElementWorker (C:\Users\Juda-OzbayEmilia\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:64209:28)
at checkSourceElement (C:\Users\Juda-OzbayEmilia\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:64128:17)
at Object.forEach (C:\Users\Juda-OzbayEmilia\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:130:30)
at C:\Users\Juda-OzbayEmilia\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:64136:31
at Object.forEach (C:\Users\Juda-OzbayEmilia\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:130:30)
at checkSourceElementWorker (C:\Users\Juda-OzbayEmilia\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:64134:20)
at checkSourceElement (C:\Users\Juda-OzbayEmilia\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:64128:17)
at Object.forEach (C:\Users\Juda-OzbayEmilia\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:130:30)
at checkSourceFileWorker (C:\Users\Juda-OzbayEmilia\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:64445:20)
Workbench link:
https://www.typescriptlang.org/dev/bug-workbench/?#code/PTAEAEDMEsBsFMB2BDAtvAXKA7tAJgObwAuAdAFYDOAUAMazKWWgDq+RxoA3taH6LQD2iSsQBOAV1rFBYgBQBKbtV78AvtQ3VgAKh28dEeo2YBlAA7xa0ZLDaESBiPAAexJHmb2OBpwBUAC2hmYyZQV3NBSnhmZFALKxtYHHYSUgNgFV19UENwIRFxKRkxX1zQAGExeGR3UDiAA0pLa1tvEgb03MzQsxak9s5Xd0RPVlTOHn4BYVFJaVlFZVU+DS0I2U48eEhkCVhOBNa7CYBuIA
TypeScript Version: 4.1.2
Search Terms: JSDoc, extends
If a detached JSDoc class docstring which uses
@extendsis placed in a.jsfile,tscwill crash. This does not happen when the@extendstag is not present.Code
widget.js
tsc command
Exepected behavior:
Even though the docstring for the constructor is misplaced, this should not cause
tscto fail.Actual behavior:
Workbench link:
https://www.typescriptlang.org/dev/bug-workbench/?#code/PTAEAEDMEsBsFMB2BDAtvAXKA7tAJgObwAuAdAFYDOAUAMazKWWgDq+RxoA3taH6LQD2iSsQBOAV1rFBYgBQBKbtV78AvtQ3VgAKh28dEeo2YBlAA7xa0ZLDaESBiPAAexJHmb2OBpwBUAC2hmYyZQV3NBSnhmZFALKxtYHHYSUgNgFV19UENwIRFxKRkxX1zQAGExeGR3UDiAA0pLa1tvEgb03MzQsxak9s5Xd0RPVlTOHn4BYVFJaVlFZVU+DS0I2U48eEhkCVhOBNa7CYBuIA