title: Disambiguate two equally specific, identical signatures (generic methods)
body: <p>Consider the following class:</p>
  
  <pre><code>public class TwoWayMap&lt;T1, T2&gt;
  {
      public T2 Get(T1 x)
      {
          throw new System.NotImplementedException();
      }
  
      public T1 Get(T2 x)
      {
          throw new System.NotImplementedException();
      }
  }
  </code></pre>
  
  <p>If T1 and T2 are different types and we call <code>Get</code>, then the compiler knows which one we mean.</p>
  
  <pre><code>var map1 = new TwoWayMap&lt;int, string&gt;();
  map1.Get("hello");
  map1.Get(5);
  </code></pre>
  
  <p>However, if the types are equal, then the two methods share the same signature. And in terms of overload resolution, they are equally specific (compared to, say, <a href="https://stackoverflow.com/questions/3679562">a generic vs a non-generic parameter</a>). Therefore, we cannot call the method unambiguously.</p>
  
  <pre><code>var map2 = new TwoWayMap&lt;int, int&gt;();
  map2.Get(5);
  </code></pre>
  
  <blockquote>
    <p>Compiler Error CS0121: The call is ambiguous between the following
    methods or properties: 'TwoWayMap.Get(T1)' and 'TwoWayMap.Get(T2)'</p>
  </blockquote>
  
  <p>Of course, we can (and should) avoid this issue by not using equal types or by providing dedicated <code>Get1</code> and <code>Get2</code> methods, but I am wondering: Is there some way in C# or .NET to disambiguate this? Is it possible to call <code>map2.Get()</code>?</p>