title: Why is this call ambiguous?
body: <p>Can anyone explain, why does the following code produce the error? (Compiling in Microsoft Visual Studio 2008)</p>
  
  <pre><code>class Base1 {  };
  class Base2 {  }
  
  interface I1   {   }
  interface I2   {   }
  
  class C : I1, I2 { }
  
  static class Program
  {
  
      static T M1&lt;T&gt;(this T t, I1 x) where T : Base1
      {
          return t;
      }
  
      static T M1&lt;T&gt;(this T t, I2 x) where T : Base2
      {
          return t;
      }
  
      static void Main(string[] args)
      {
          Base1 b1 = new Base1();
          C c = new C();
          b1.M1(c);
      }
  }
  </code></pre>
  
  <p>the error is </p>
  
  <blockquote>
    <p>The call is ambiguous between the following methods or properties: '<code>ConsoleApplication1.Program.M1&lt;ConsoleApplication1.Base1&gt;(ConsoleApplication1.Base1, ConsoleApplication1.I1)</code>' and '<code>ConsoleApplication1.Program.M1&lt;ConsoleApplication1.Base1&gt;(ConsoleApplication1.Base1, ConsoleApplication1.I2)</code>'
    </p>
  </blockquote>
  
  <p>I thought the compiler could distinguish between two methods using the "where" clauses</p>