@@ -14483,6 +14483,7 @@ namespace ts {
14483
14483
case SyntaxKind.PlusToken:
14484
14484
case SyntaxKind.MinusToken:
14485
14485
case SyntaxKind.TildeToken:
14486
+ checkNonNullType(operandType, node.operand);
14486
14487
if (maybeTypeOfKind(operandType, TypeFlags.ESSymbol)) {
14487
14488
error(node.operand, Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol, tokenToString(node.operator));
14488
14489
}
@@ -14494,7 +14495,7 @@ namespace ts {
14494
14495
booleanType;
14495
14496
case SyntaxKind.PlusPlusToken:
14496
14497
case SyntaxKind.MinusMinusToken:
14497
- const ok = checkArithmeticOperandType(node.operand, getNonNullableType (operandType),
14498
+ const ok = checkArithmeticOperandType(node.operand, checkNonNullType (operandType, node.operand ),
14498
14499
Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type);
14499
14500
if (ok) {
14500
14501
// run check only if former checks succeeded to avoid reporting cascading errors
@@ -14510,7 +14511,7 @@ namespace ts {
14510
14511
if (operandType === silentNeverType) {
14511
14512
return silentNeverType;
14512
14513
}
14513
- const ok = checkArithmeticOperandType(node.operand, getNonNullableType (operandType),
14514
+ const ok = checkArithmeticOperandType(node.operand, checkNonNullType (operandType, node.operand ),
14514
14515
Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type);
14515
14516
if (ok) {
14516
14517
// run check only if former checks succeeded to avoid reporting cascading errors
0 commit comments