title: RuntimeMethodInfo equality: bug?
body: <p>Lets start with: </p>
  
  <pre><code>using System;
  
  public class Program
  {
      class A
      {
          public virtual void Do() { }
      }
  
      class B:A
      {
      }
  
      public static void Main()
      {
          var m1 = typeof(A).GetMethod("Do");
          var m2 = typeof(B).GetMethod("Do");
  
          Console.WriteLine("Methods are equal?\t\t{0}", m1 == m2);
          Console.WriteLine("Method handles are equal?\t{0}", m1.MethodHandle == m2.MethodHandle);
  
          Console.WriteLine("Done.");
          Console.ReadKey();
      }
  }
  </code></pre>
  
  <p>(<a href="http://ideone.com/G8cyZ7" rel="nofollow noreferrer">try it online</a> at ideone)</p>
  
  <p>So, there are two unequal <code>MethodInfo</code> instances, both containing the same method handle. Here's <a href="http://referencesource.microsoft.com/#mscorlib/system/reflection/methodinfo.cs#52" rel="nofollow noreferrer">the equals operator source</a>:</p>
  
  <pre><code>public static bool operator ==(MethodInfo left, MethodInfo right)
  {
      if (ReferenceEquals(left, right))
          return true;
  
      if ((object)left == null || (object)right == null ||
          left is RuntimeMethodInfo || right is RuntimeMethodInfo) // &lt;----??? 
      {
          return false;
      }
      return left.Equals(right);
  }
  </code></pre>
  
  <p>It doesn't look like an accidental bug, at least until there was assumption that all instances of <code>RuntimeMethodInfo</code> are cached and there newer will be two different instances for the same method. In that case something is broken, obviously.</p>
  
  <p>Any reasons behind this behavior, anyone?</p>
  
  <p>P.S. Do not mark as a [duplicate], please:) The question is not about 'how to compare?'. That one was answered multiple times, <a href="https://stackoverflow.com/q/4168489/318263">here</a> and <a href="https://stackoverflow.com/q/8431866/318263">here</a> for example.</p>
  
  <p>Thanks!</p>