mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-07-06 06:49:29 -05:00
Make it a parse error for an @augments jsdoc tag to not include a type (#18745)
This commit is contained in:
@@ -6599,12 +6599,12 @@ namespace ts {
|
||||
const result = <JSDocTypeTag>createNode(SyntaxKind.JSDocTypeTag, atToken.pos);
|
||||
result.atToken = atToken;
|
||||
result.tagName = tagName;
|
||||
result.typeExpression = parseJSDocTypeExpression(/*mayBail*/ true);
|
||||
result.typeExpression = parseJSDocTypeExpression(/*requireBraces*/ true);
|
||||
return finishNode(result);
|
||||
}
|
||||
|
||||
function parseAugmentsTag(atToken: AtToken, tagName: Identifier): JSDocAugmentsTag {
|
||||
const typeExpression = tryParseTypeExpression();
|
||||
const typeExpression = parseJSDocTypeExpression(/*requireBraces*/ true);
|
||||
|
||||
const result = <JSDocAugmentsTag>createNode(SyntaxKind.JSDocAugmentsTag, atToken.pos);
|
||||
result.atToken = atToken;
|
||||
|
||||
@@ -144,6 +144,11 @@ namespace ts {
|
||||
`/**
|
||||
* @type
|
||||
*/`);
|
||||
|
||||
parsesIncorrectly("@augments with no type",
|
||||
`/**
|
||||
* @augments
|
||||
*/`);
|
||||
});
|
||||
|
||||
describe("parsesCorrectly", () => {
|
||||
|
||||
Reference in New Issue
Block a user