On Sep 26, 12:39 pm, "santi...@gmail.com" <santi...@gmail.com> wrote:
> Hi everyone,
>
[quoted text clipped - 14 lines]
> thanks in advance,
> Santi
MSDN and Rick Byers can explain generic type invariance better than I
could :)
http://msdn2.microsoft.com/en-us/library/ms228359(vs.80).aspx
http://blogs.msdn.com/rmbyers/archive/2005/02/16/375079.aspx
http://blogs.msdn.com/rmbyers/archive/2006/06/01/613690.aspx
Santi,
Here is a response to a previous thread which answers this:
http://groups.google.com/group/microsoft.public.dotnet.languages.csharp/msg/7c96
4a0781c7ec65
Basically, because while the CLR supports covariance with Generics, C#
doesn't expose that functionality.
Here is the rest of the thread with more details:
http://groups.google.com/group/microsoft.public.dotnet.languages.csharp/browse_t
hread/thread/b47879b2fecdf61a/55824f601c2e11b6?lnk=st&q=nicholas+paldino+generic
+covariance&rnum=2#55824f601c2e11b6

Signature
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com
> Hi everyone,
>
[quoted text clipped - 14 lines]
> thanks in advance,
> Santi
santimbs@gmail.com - 26 Sep 2007 22:28 GMT
Very explanatory links, thank you.
Ben Voigt [C++ MVP] - 26 Sep 2007 23:11 GMT
> Santi,
>
[quoted text clipped - 4 lines]
> Basically, because while the CLR supports covariance with Generics, C#
> doesn't expose that functionality.
IList, which supports both input and output, cannot be covariant (or
contravariant).
> Here is the rest of the thread with more details:
>
[quoted text clipped - 18 lines]
>> thanks in advance,
>> Santi