Arrays are non-generic. They implement IEnumerable
but not IEnumerable<T>
. So how is it possible that the following code compiles and executes fine ?
int[] myArray = {1,2,3,4};
IEnumerable<int> myEnum = myArray;
List<int> myList = new List<int>(myArray);