title: Why is "long" being allowed as array length in C#?
body: <p>I wanted to try to allocate a 4 billion bytes array and this is my C# code:</p>
  
  <pre><code>long size = 4 * 1000;
  size *= 1000;
  size *= 1000;
  byte[] array = new byte[size];
  </code></pre>
  
  <p>this code fails with <code>System.OverflowException</code> on the line containing <code>new</code>. Okay, turns out <code>Length</code> returns <code>int</code>, so the array length is also limited to what <code>int</code> can store.</p>
  
  <p>Then why is there no compile-time error and <code>long</code> is allowed to be used as the number of array elements at allocation?</p>