> ICollection<A> acoll;
> ICollection<B> bcoll;
> A[] cat;
> ICollection<A>.CopyTo(A[],int)
> ICollection<B>.CopyTo(B[],int) - note the signature, the destination array 
> can't be an array of supertype. There's no chance to throw an exception 
> because the code doesn't pass type check at compile time.

To ease understanding:

ICollection<Animal> acoll;
ICollection<Cat> ccoll;
Animal[] animals;
ICollection<Animal>.CopyTo(Animal[],int)
ICollection<Cat>.CopyTo(Cat[],int)

Reply via email to