mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-18 06:17:19 -05:00
fix(44701): allow renaming string literal in rhs/lhs of equality (#44708)
This commit is contained in:
@@ -802,6 +802,11 @@ namespace ts {
|
||||
return contextualType;
|
||||
}
|
||||
|
||||
const parent = node.parent;
|
||||
if (parent && isBinaryExpression(parent) && isEqualityOperatorKind(parent.operatorToken.kind)) {
|
||||
return checker.getTypeAtLocation(node === parent.left ? parent.right : parent.left);
|
||||
}
|
||||
|
||||
const ancestorTypeNode = getAncestorTypeNode(node);
|
||||
return ancestorTypeNode && checker.getTypeAtLocation(ancestorTypeNode);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user