I am wondering how an array has different behaviour to List<T>, both which implement IList, where the array appears to be getting around IList's non-covariant nature (it is not defined as IList<out T>), when assigning to IList<IPerson>.
In the below example all assignments are ok except for 'people3'. Why does the assignment work in the case of 'people4' for personArray?
public interface IPerson { }
public class Person : IPerson { }
var personList = new List<Person>();
var personArray = new Person[0];
IList<Person> people1 = personList;
IList<Person> people2 = personArray;
IList<IPerson> people3 = personList;
IList<IPerson> people4 = personArray;