title: Why can't I overload a method with the same parameters if I choose different generic restraints?
body: <p>If I do this in c# 4.0 .NET </p>
  
  <pre><code>    private static void myMethod&lt;T&gt;(int obj) where T : IDictionary
      {
  
  
      }
  
      private static void myMethod&lt;T&gt;(int obj) where T : ICollection
      {
  
  
      }
  </code></pre>
  
  <p>I get the following error.</p>
  
  <blockquote>
    <p>Type
    'ConsoleApplication1.Program' already
    defines a member called 'myMethod'
    with the same parameter
    types </p>
  </blockquote>
  
  <p>I would like to know why? As far as I see, both these methods can be called without ambiguity?</p>
  
  <p>If I wanted the first method, I'd do this</p>
  
  <pre><code>myMethod&lt;IDictionary&gt;(50)
  </code></pre>
  
  <p>and second method</p>
  
  <pre><code>myMethod&lt;ICollection&gt;(40)
  </code></pre>
  
  <p>What scenario am I missing? And is there a way to achieve a set of overloaded methods with the same parameters but a different type?</p>