title: Generic type parameter covariance and multiple interface implementations
body: <p>If I have a generic interface with a covariant type parameter, like this:</p>
  
  <pre><code>interface IGeneric&lt;out T&gt;
  {
      string GetName();
  }
  </code></pre>
  
  <p>And If I define this class hierarchy:</p>
  
  <pre><code>class Base {}
  class Derived1 : Base{}
  class Derived2 : Base{}
  </code></pre>
  
  <p>Then I can implement the interface twice on a single class, like this, using explicit interface implementation:</p>
  
  <pre><code>class DoubleDown: IGeneric&lt;Derived1&gt;, IGeneric&lt;Derived2&gt;
  {
     string IGeneric&lt;Derived1&gt;.GetName()
     {
       return "Derived1";
     }
  
     string IGeneric&lt;Derived2&gt;.GetName()
     {
       return "Derived2";
     }  
  }
  </code></pre>
  
  <p>If I use the (non-generic)<code>DoubleDown</code> class and cast it to <code>IGeneric&lt;Derived1&gt;</code> or <code>IGeneric&lt;Derived2&gt;</code> it functions as expected:</p>
  
  <pre><code>var x = new DoubleDown();
  IGeneric&lt;Derived1&gt; id1 = x;        //cast to IGeneric&lt;Derived1&gt;
  Console.WriteLine(id1.GetName());  //Derived1
  IGeneric&lt;Derived2&gt; id2 = x;        //cast to IGeneric&lt;Derived2&gt;
  Console.WriteLine(id2.GetName());  //Derived2
  </code></pre>
  
  <p>However, casting the <code>x</code> to <code>IGeneric&lt;Base&gt;</code>, gives the following result:</p>
  
  <pre><code>IGeneric&lt;Base&gt; b = x;
  Console.WriteLine(b.GetName());   //Derived1
  </code></pre>
  
  <p>I expected the compiler to issue an error, as the call is ambiguous between the two implementations, but it returned the first declared interface. </p>
  
  <p>Why is this allowed?</p>
  
  <p>(inspired by <a href="https://stackoverflow.com/questions/14560134/a-class-implementing-two-different-iobservables">A class implementing two different IObservables?</a>. I tried to show to a colleague that this will fail, but somehow, it didn't)</p>