title: C# generic method resolution fails with an ambiguous call error
body: <p>Suppose I have defined two unrelated types and two extension methods with the same signature but different type filters:</p>
  
  <pre><code>public class Foo {}
  public class Bar {}
  
  public static class FooExtensions
  {
      public static TFoo Frob&lt;TFoo&gt;(this TFoo foo) where TFoo : Foo { }
      public static TFoo Brob&lt;TFoo&gt;(this TFoo foo) where TFoo : Foo { }
  }
  
  public static class BarExtensions
  {
      public static TBar Frob&lt;TBar&gt;(this TBar bar) where TBar : Bar { }
  }
  </code></pre>
  
  <p>Then when I write <code>new Foo().Frob();</code> I get an error </p>
  
  <p><code>error CS0121: The call is ambiguous between the following methods or properties: 'FooExtensions.Frob&lt;TFoo&gt;(TFoo)' and 'BarExtensions.Frob&lt;TBar&gt;(TBar)'</code></p>
  
  <p>Could someone explain why this fails and how to avoid it?</p>
  
  <p>EDIT: This happens in VS2015 Update 3 and VS2017 RC.</p>
  
  <p>EDIT2: The idea here is to have fluent API that works on a class hierarchy:</p>
  
  <pre><code>new Foo()
    .Frob()
    .Brob()
  </code></pre>