Ayende @ Rahien

Refunds available at head office

Covariance in delegates

I'm not sure if it's the way to call it, but why does the C# compiler errors on this:

public IList<object> GetList()
{
   return new List<string>();
}

Seems to me that a generic of a derived type should be able to satisfy the compiler when requesting a generic of a base type.

Any idea what the reasoning behind this decision was?

Comments

No comments posted yet.

Comments have been closed on this topic.