mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-19 10:41:56 -05:00
Merge pull request #12158 from Microsoft/fix-literal-comparability-in-relational-comparison-operators
Fix literal comparability in relational comparison operators
This commit is contained in:
@@ -14502,6 +14502,8 @@ namespace ts {
|
||||
case SyntaxKind.LessThanEqualsToken:
|
||||
case SyntaxKind.GreaterThanEqualsToken:
|
||||
if (checkForDisallowedESSymbolOperand(operator)) {
|
||||
leftType = getBaseTypeOfLiteralType(leftType);
|
||||
rightType = getBaseTypeOfLiteralType(rightType);
|
||||
if (!isTypeComparableTo(leftType, rightType) && !isTypeComparableTo(rightType, leftType)) {
|
||||
reportOperatorError();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user