www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Covariance and Contravariance in C# 1 - 11

I have just started reading the articles of this series, but I think they can
be useful to solve the problems like one in dmd bug 2563. They are titled

them here and in the successive page:

http://blogs.msdn.com/ericlippert/archive/2007/10/16/covariance-and-contravariance-in-c-part-one.aspx

After those eleven articles there is this too that seems related:
http://blogs.msdn.com/ericlippert/archive/2009/09/24/why-is-covariance-of-value-typed-arrays-inconsistent.aspx



http://en.wikipedia.org/wiki/C_sharp_4#Covariant_and_contravariant_generic_type_parameters

See the syntax:
interface IEnumerable<out T> {
  IEnumerator<T> GetEnumerator();
}

I have also asked something related in the d.learn group:
http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D.learn&article_id=19213

Bye,
bearophile
Mar 21 2010