Skip to content

Commit 9ff723c

Browse files
committed
Apply suggestions from code review
1 parent 34aed6e commit 9ff723c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/compiler/checker.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27162,7 +27162,8 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
2716227162
return isConstantReference((node as AccessExpression).expression) && isReadonlySymbol(getNodeLinks(node).resolvedSymbol || unknownSymbol);
2716327163
case SyntaxKind.ObjectBindingPattern:
2716427164
case SyntaxKind.ArrayBindingPattern:
27165-
return isBindingElement(node.parent) ? isConstantReference(node.parent.parent) : isVariableDeclaration(node.parent) && isVarConstLike(node.parent);
27165+
const rootDeclaration = getRootDeclaration(node.parent);
27166+
return isVariableDeclaration(rootDeclaration) && isVarConstLike(rootDeclaration);
2716627167
}
2716727168
return false;
2716827169
}

0 commit comments

Comments
 (0)