Skip to content

Commit 7253100

Browse files
committed
tweak the check
1 parent 74f57f6 commit 7253100

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/compiler/checker.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,7 @@ import {
476476
isCallOrNewExpression,
477477
isCallSignatureDeclaration,
478478
isCatchClause,
479+
isCatchClauseVariableDeclaration,
479480
isCatchClauseVariableDeclarationOrBindingElement,
480481
isCheckJsEnabledForFile,
481482
isClassDeclaration,
@@ -27461,7 +27462,9 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
2746127462
case SyntaxKind.ObjectBindingPattern:
2746227463
case SyntaxKind.ArrayBindingPattern:
2746327464
const rootDeclaration = getRootDeclaration(node.parent);
27464-
return isVariableDeclaration(rootDeclaration) ? isVarConstLike(rootDeclaration) : !isSomeSymbolAssigned(rootDeclaration);
27465+
return isParameter(rootDeclaration) || isCatchClauseVariableDeclaration(rootDeclaration)
27466+
? !isSomeSymbolAssigned(rootDeclaration)
27467+
: isVariableDeclaration(rootDeclaration) && isVarConstLike(rootDeclaration);
2746527468
}
2746627469
return false;
2746727470
}

0 commit comments

Comments
 (0)