tsc crashes when it sees a JSDoc tag inside an @override annotation (regression in TS 4.8) #50717
Labels
Bug
A bug in TypeScript
Crash
For flagging bugs which are compiler or service crashes or unclean exits, rather than bad output
Fix Available
A PR has been opened for this issue
Milestone
Bug Report
This code compiles successfully in TypeScript 4.7.4 and crashes tsc in TypeScript 4.8.2 and 4.8.3 (I did not test 4.8.0 or 4.8.1):
The error is:
Putting another JSDoc tag inside an
@override
is incorrect, so it's fine for the compiler to complain about it, but the stack trace is not very helpful in tracking down what is happening.In the codebase in which I encountered this error, the method this was decorating (the equivalent of
B.doIt
in the example above) had anoverride
keyword, so the@override
JSDoc tag was just for documentation, making this error even more surprising. The documentation was added before theoverride
keyword was added to TypeScript. I fixed it by changing the tag to@see
.🕗 Version & Regression Information
⏯ Playground Link
Playground link with relevant code
🙁 Actual behavior
tsc crashed
🙂 Expected behavior
tsc ignores
@override
JSDoc tags in comments or reports a more friendly error or warning when@override
is invalidThe text was updated successfully, but these errors were encountered: