Each C# array is supposed to implicilty derive from class Array which implements
the non-generic IEnumerable
public abstract class Array : ICloneable, IList, ICollection, IEnumerable, IStructuralComparable, IStructuralEquatable
IEnumerable
gets only four extension methods. However, each array gets also extension methods
from the generic IEnumerable<<T>>
. The problem is that class Array does not implement IEnumerable<<T>>
The MSDN docs for class Array state that "Starting with the .NET Framework 2.0, the Array class
implements the generic interfaces like System.Collections.Generic.IEnumerable<<T>>
The implementations are provided to arrays at run time, and as a result, the generic interfaces
do not appear in the declaration syntax for the Array class"
So my question is why the class Array does not implement IEnumerable<<T>>
explicitly when it
implements IEnumerable<<T>>
implicitly anyway. What does it mean that implemenation is provided
at runtime when the compiler compiles it at compile time, and Intellisense shows extension
methods for IEnumerable<<T>>
added to any array variable at edit time.