{"id":4132,"date":"2014-03-30T08:01:27","date_gmt":"2014-03-30T08:01:27","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/problem-about-generic-variance-collection-of-common-programming-errors\/"},"modified":"2014-03-30T08:01:27","modified_gmt":"2014-03-30T08:01:27","slug":"problem-about-generic-variance-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/problem-about-generic-variance-collection-of-common-programming-errors\/","title":{"rendered":"problem about generic-variance-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/97e293cbc474ca83db5ce58289c3f454?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nGabe<br \/>\nc# c#-4.0 type-conversion generic-variance<br \/>\nCurrently I&#8217;m preparing a presentation of the new generic variance features in C# for my colleagues. To cut the story short I wrote following lines:IList&lt;Form&gt; formsList = new List&lt;Form&gt; { new Form(), new Form() }; IList&lt;Control&gt; controlsList = formsList;Yes, this is of course not possible, as IList(Of T) is invariant (at least my thought). The compiler tells me that: Cannot implicitly convert type &#8216;System.Collections.Generic.IList&lt;System.Windows.Forms.Form&gt;&#8217; to &#8216;System.C<\/li>\n<\/ul>\n<p>Web site is in building<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Gabe c# c#-4.0 type-conversion generic-variance Currently I&#8217;m preparing a presentation of the new generic variance features in C# for my colleagues. To cut the story short I wrote following lines:IList&lt;Form&gt; formsList = new List&lt;Form&gt; { new Form(), new Form() }; IList&lt;Control&gt; controlsList = formsList;Yes, this is of course not possible, as IList(Of T) is invariant [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4132","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4132","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=4132"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4132\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=4132"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=4132"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=4132"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}