[Mono-list] Crazy generic dictionary?

Andrus kobruleht2 at hot.ee
Mon Oct 1 05:05:50 EDT 2007


>FooDictionary<mytype> foo = new FooDictionary<mytype>();
>foo.Add(new List<subtypeA>());

>Error 11 Argument '1': cannot convert from 
>'System.Collections.Generic.List<subtypeA>' to 
>'System.Collections.Generic.List<mytype>'

>However, it should allow it because subtypeA inherits from mytype, 
>right? I think I've reached a limitation of .NET generics, which I think 

See also

http://blogs.msdn.com/rmbyers/archive/2005/02/16/375079.aspx

Andrus.


More information about the Mono-list mailing list