
If you’re familiar with the array covariance rules that allow you to do the following, then you
might be surprised that you cannot accomplish the same thing using constructed generic types:
public void ProcessStrings( string[] myStrings ) {
object[] objs = myStrings;
foreach( object o in objs ) {
Console.WriteLine( o );
}
}
The difference is that with array covariance, the source and the destination of the assignment
are of the same type, System.Array. The array covariance rules simply allow you to assign one array
from another, as long as the declared type of the elements in the array is implicitly convertible at
compile time. However, in the case of ...