I was reading an interview with Joshua Bloch in Coders at Work, where he lamented the introduction of generics in Java 5. He doesn\'t like the specific implementation largel
C# 4 introduces new features that allow covariance and contravariance in generics.
There are other SO posts that talk about this in more detail: How is Generic Covariance & Contra-variance Implemented in C# 4.0?
The new feature does not enable this automatically in all types, but there is a new syntax that allows developers to specify whether generic arguments are covariant or contravariant.
C# versions prior to C# 4 had limited functionality similar to this as it pertains to delegates and certain array types. With regard to delegates, delegates that take in base parameter types are allowed. With regard to array types, I think it's valid unless there would be boxing involved. That is, an array of Customer can be case to an array of object. However, an array of ints cannot be cast to an array of objects.