I have just noticed that a multidimensional array in C#, does not implement IEnumerable<T>, while it does implement IEnumerable. For single-dimensional arrays, both IEnumerable<T> and IEnumerable is implemented.
Why this difference ? If a multi-dimensional array is IEnumerable, surely it should also implement the generic version ? I noticed this because I tried to use an Extension method on an multidimensional array, which fails unless you use Cast or similar; so I can definitely see the an argument for making multidimensional arrays implement IEnumerable<T>.
To clarify my question in code, I would expect the following code to print True four times, while it actually prints True, False, True, True:
int[] singleDimensionArray = new int[10];
int[,] multiDimensional = new int[10, 10];
Debug.WriteLine(singleDimensionArray is IEnumerable<int>);
Debug.WriteLine(multiDimensional is IEnumerable<int>);
Debug.WriteLine(singleDimensionArray is IEnumerable);
Debug.WriteLine(multiDimensional is IEnumerable);