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

This commit is contained in:
Oleksandr T authored and GitHub committed 2021-09-29 12:16:27 -07:00
1 parent 061f02cd64
commit e96c10fe0c
6 files changed
+153 -1

No files matched your search

+1 -1
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);
}