title: Generic method that further constrains the class type parameter
body: <p>I have a data structure with a <code>BisectLeft</code> method</p>
  <pre class="lang-cs prettyprint-override"><code>public class MyStruct&lt;T&gt; where T: IComparable&lt;T&gt;
  {
      public T BisectLeft(T item) {...}
  }
  </code></pre>
  <p>I would like to add an overload of <code>BisectLeft</code> for a generic type <code>U</code> where <code>T: IComparable&lt;U&gt;</code></p>
  <pre class="lang-cs prettyprint-override"><code>    public T BisectLeft(T item) {...}
  
      public T BisectLeft&lt;U&gt;(U item) where T: IComparable&lt;U&gt; {...}
  </code></pre>
  <p>This doesn't compile because it cannot resolve the type <code>T</code>. I also cannot add <code>T</code> as <code>BisectLeft&lt;T, U&gt;</code> because <code>T</code> would be considered a duplicate of the type parameter of the class <code>MyStruct&lt;T&gt;</code>.</p>
  <p>Is there anyway to achieve this without adding <code>U</code> as a type parameter of the class?</p>