title: C# List<Interface>: why you cannot do `List<IFoo> foo = new List<Bar>();`
body: <p>If you have an Interface <code>IFoo</code> and a class <code>Bar : IFoo</code>, why can you do the following:</p>
  
  <pre><code>List&lt;IFoo&gt; foo = new List&lt;IFoo&gt;();  
  foo.Add(new Bar());
  </code></pre>
  
  <p>But you cannot do:</p>
  
  <pre><code>List&lt;IFoo&gt; foo = new List&lt;Bar&gt;();
  </code></pre>