Code inspection: 'Enumerable.Sum' invocation in explicit unchecked context
This inspection reports a call to Enumerable.Sum inside an explicit unchecked context. Enumerable.Sum still performs its own overflow checking, so wrapping the call in unchecked does not usually behave the way it might seem.
Example
using System.Linq;
unchecked
{
var total = numbers.Sum();
}
using System.Linq;
var total = numbers.Sum();
Quick-fix
There is no dedicated quick-fix for this inspection. A typical correction is to remove the unnecessary unchecked context around the Sum call, or replace the LINQ call with code that matches the overflow behavior you want.
01 April 2026