ChallengeWhy isn’t select broken?

time to read 1 min | 114 words

Here is a crash report that I got.

System.ArgumentException: Destination array was not long enough. Check destIndex and length, and the array's lower bounds.
  at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable)
  at System.Collections.Generic.List`1.CopyTo(T[] array, Int32 arrayIndex)
  at System.Collections.ObjectModel.Collection`1.CopyTo(T[] array, Int32 index)
  at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
  at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)

Now, it is tempting to blame Microsoft for this, but it is actually my fault.

Care to guess why?

More posts in "Challenge" series:

  1. (03 Jan 2020) Spot the bug in the stream–answer
  2. (15 Feb 2010) Where is the optimization?