MCPcopy Index your code
hub / github.com/nodejs/node / checkPostfixUnaryExpression

Function checkPostfixUnaryExpression

test/fixtures/snapshot/typescript.js:78518–78529  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

78516 return errorType;
78517 }
78518 function checkPostfixUnaryExpression(node) {
78519 var operandType = checkExpression(node.operand);
78520 if (operandType === silentNeverType) {
78521 return silentNeverType;
78522 }
78523 var ok = checkArithmeticOperandType(node.operand, checkNonNullType(operandType, node.operand), ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type);
78524 if (ok) {
78525 // run check only if former checks succeeded to avoid reporting cascading errors
78526 checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access);
78527 }
78528 return getUnaryResultType(operandType);
78529 }
78530 function getUnaryResultType(operandType) {
78531 if (maybeTypeOfKind(operandType, 2112 /* TypeFlags.BigIntLike */)) {
78532 return isTypeAssignableToKind(operandType, 3 /* TypeFlags.AnyOrUnknown */) || maybeTypeOfKind(operandType, 296 /* TypeFlags.NumberLike */)

Callers 1

checkExpressionWorkerFunction · 0.85

Calls 5

checkNonNullTypeFunction · 0.85
checkReferenceExpressionFunction · 0.85
getUnaryResultTypeFunction · 0.85
checkExpressionFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…