Code inspection: Suspicious shift count for this type of left operand
This inspection reports shift expressions where the written shift count is not the shift count that will actually be used. In C#, the runtime truncates the right operand of a shift operation. For example, shifting an int by 40 really shifts it by 8. This often means the left operand has the wrong type or the count is incorrect.
Example
const ulong mask = 0x8000_0000 << 1;
const ulong mask = (ulong)0x8000_0000 << 1;
Quick-fix
Correct the left operand type or the shift count to ensure the operation behaves as intended.
01 April 2026