Can anyone explain that :
- compile OK
- run-time KO
I already checked source code for IEnumerable<> & IEnumerable and found nothing FYI this doesn't work with List
class Program
{
public class Person
{
public long Age { get; set; }
}
static void Main(string[] args)
{
IEnumerable<Person> list = new List<Person>();
((Person)list).Age = 5;
}
}