ReSharper 2026.1 Help

Code inspection: Possible overflow in 'unchecked' context

This inspection reports arithmetic on int values that can overflow when the code uses unchecked integer semantics. In that case, the value wraps around instead of throwing an exception.

Example

int value = int.MaxValue + 1;

This produces a wrapped result instead of the mathematically expected value.

How to fix it

There is no dedicated quick-fix for this inspection. Typical fixes are to use a wider type, validate the input range, or make the overflow behavior explicit and intentional.

long value = (long)int.MaxValue + 1;
01 April 2026