menu

no-erasing-operation

Disallow operations that erase their operand into a constant

An integral operation with an erasing operand produces a constant whenever the operation completes. Instead, you SHOULD correct the operator or constant operand that caused the value to be discarded.

Reported

1function erase(value: int32): int32 {2    return value * 0;3}

Accepted

1function retain(value: int32): int32 {2    return value;3}