title: casting to base interface implementation of reimplemented interface
body: <p>I have an interface <code>IFace</code> implemented by class <code>Animal</code>. I cannot modify <code>IFace</code> or <code>Animal</code>. I want to extend <code>Animal</code> with my subclass <code>Human</code> and have it reimplement <code>IFace</code>. However, I want to be able to store an instance of <code>Human</code> in a variable of type <code>IFace</code> such that accessing that variable uses the <code>Animal</code> implementation directly—as if the variable’s type was <code>Animal</code>.</p>
  
  <p><a href="https://dotnetfiddle.net/6JjNfR" rel="nofollow">https://dotnetfiddle.net/6JjNfR</a></p>
  
  <pre><code>using System;
  
  interface IFace
  {
      void Talk();
  }
  class Animal : IFace
  {
      public void Talk()
      {
          Console.WriteLine("Oink");
      }
  }
  class Human : Animal, IFace
  {
      public new void Talk()
      {
          Console.WriteLine("Hi");
      }
  }
  
  public class Program
  {
      public static void Main()
      {
          var human = new Human();
          human.Talk();
  
          var face = (IFace)human;
          face.Talk();
  
          var animal = (Animal)human;
          animal.Talk();
  
          var face2 = animal;
          face2.Talk();
  
          IFace face3;
          face3 = human;
          face3.Talk();
  
          // How to get the following to oink like animal?
          face3 = animal;
          face3.Talk();
      }
  }
  </code></pre>
  
  <p>Is this possible or do I have to create a proxy class like the following?</p>
  
  <p><a href="https://dotnetfiddle.net/marXND" rel="nofollow">https://dotnetfiddle.net/marXND</a></p>
  
  <pre><code>class AnimalProxy : IFace
  {
      Animal Animal { get; set; }
  
      public AnimalProxy(Animal animal)
      {
          Animal = animal;
      }
  
      public void Talk()
      {
          Animal.Talk();
      }
  }
  </code></pre>
  
  <p>And if the proxy is required, why is the proxy required if I can access the <code>Animal</code> implementation of <code>IFace</code> by just casting to <code>Animal</code>?</p>
  
  <p>I bet the answer has something to do with how explicit interfaces work and how casting a <code>Human</code> to an <code>Animal</code> and then again casting to <code>IFace</code> <em>should</em> return <code>Human</code>’s implementation… Maybe implicit interface implementation syntax just lets the C# compiler automatically generate an explicit implementation which just calls the implicit implementation. Which means that when I cast something to <code>Animal</code> I’m accessing <code>Animal</code> methods instead of <code>IFace</code> methods even though those same methods are the “implicit” implementation of <code>IFace</code>.</p>
  
  <p>So, how can I cast directly to the base implementation of a reimplemented interface—and if that’s impossible, why?</p>