Report Syntax Errors in JSDocs Type Annotations #13371
Copy link
Copy link
Closed
Labels
FixedA PR has been merged for this issueA PR has been merged for this issueSuggestionAn idea for TypeScriptAn idea for TypeScriptVS Code TrackedThere is a VS Code equivalent to this issueThere is a VS Code equivalent to this issue
Milestone
Description
TypeScript Version: 2.2.0-dev.20170109
Code
In a JS file:
/**
* @param {(x)=>void} x
**/
function foo(x) { }Expected behavior:
Reports a syntax error when trying to parse the JSDoc type annotation
Actual behavior:
No error reported. x has any type
Reacted by James Treworgy and Ricardo Medina
Metadata
Metadata
Assignees
Labels
FixedA PR has been merged for this issueA PR has been merged for this issueSuggestionAn idea for TypeScriptAn idea for TypeScriptVS Code TrackedThere is a VS Code equivalent to this issueThere is a VS Code equivalent to this issue
Activity
mhegazy commentedon Jan 9, 2017
Also related to #6802
mhegazy commentedon May 15, 2017
Nathan Shively-Sanders (@sandersn), we also need to ensure that applicable quick fixes are working correctly in JSDoc, e.g. #15852
sandersn commentedon May 30, 2017
Mohamed Hegazy (@mhegazy) Andy (Andrewkraft) (@Andy-MS) that quick fix is for a semantic error. That's a separate issue from this one which reports syntax errors. I'll re-open #15852 to track that.
You're not talking about the quick fix "Disable checking for this file", right?
sandersn commentedon May 30, 2017
Fix is up at #16156
Jessidhia commentedon Jul 5, 2017
The error there is actually on the
@typetag rather than the@typedef. But yes, sounds reasonable to raise an error.