fix(26635): allow casts only when JSDoc type directly attached to an expression (#45960)

This commit is contained in:
Oleksandr T
2021-09-29 22:16:27 +03:00
committed by GitHub
parent 061f02cd64
commit e96c10fe0c
6 changed files with 153 additions and 1 deletions

View File

@@ -33722,7 +33722,7 @@ namespace ts {
}
function checkParenthesizedExpression(node: ParenthesizedExpression, checkMode?: CheckMode): Type {
if (isJSDocTypeAssertion(node)) {
if (hasJSDocNodes(node) && isJSDocTypeAssertion(node)) {
const type = getJSDocTypeAssertionType(node);
return checkAssertionWorker(type, type, node.expression, checkMode);
}