title: C# Extension method precedence
body: <p>I'm a bit confused about how extension methods work. </p>
  
  <p>If I'm reading this correctly <a href="http://msdn.microsoft.com/en-us/library/bb383977.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/bb383977.aspx</a> and this <a href="https://stackoverflow.com/questions/2303885/if-an-extension-method-has-the-same-signature-as-a-method-in-the-sealed-class-wh">If an extension method has the same signature as a method in the sealed class, what is the call precedence?</a>. </p>
  
  <p>Then the following should write out "Instance", but instead it writes "Extension method".</p>
  
  <pre><code>interface IFoo
  {
  }
  
  class Foo : IFoo
  {
      public void Say()
      {
          Console.WriteLine("Instance");
      }
  }
  
  static class FooExts
  {
      public static void Say(this IFoo foo)
      {
          Console.WriteLine("Extension method");
      }
  }
  
  class Program
  {
      static void Main(string[] args)
      {
          IFoo foo = new Foo();
          foo.Say();
      }
  }
  </code></pre>
  
  <p>Appreciate any help in clarifying the behavior.</p>