mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-11-18 20:11:14 +00:00
fix(26635): allow casts only when JSDoc type directly attached to an expression (#45960)
This commit is contained in:
1 parent
061f02cd64
commit
e96c10fe0c
6 files changed
+153
-1
No files matched your search
@@ -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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user