The operation overflows at compile time in checked mode
An operation was detected by checked, which is the default, that resulted in a data loss. Either correct the inputs to the assignment or use unchecked to resolve this error.
The following sample generates CS0220:
using System; class TestClass { const int x = 1000000; const int y = 1000000; public int MethodCh() { int z = (x * y); // CS0220 return z; } public int MethodUnCh() { unchecked { int z = (x * y); return z; } } public static void Main() { TestClass myObject = new TestClass(); Console.WriteLine("Checked : {0}", myObject.MethodCh()); Console.WriteLine("Unchecked: {0}", myObject.MethodUnCh()); } }