Closed
Description
I get different hashcode on the same action that assigend from same virtual method
class Program
{
public virtual void VirtualMethod() { }
public void NonVirtualMethod() { }
static void Main(string[] args)
{
Program p = new Program();
Action d1 = p.VirtualMethod;
Action d2 = p.VirtualMethod;
Action d3 = p.NonVirtualMethod;
Action d4 = p.NonVirtualMethod;
Console.WriteLine("d1.GetHashCode() == d2.GetHashCode() {0}", d1.GetHashCode() == d2.GetHashCode());
Console.WriteLine("d3.GetHashCode() == d4.GetHashCode() {0}", d3.GetHashCode() == d4.GetHashCode());
}
}
d1.GetHashCode() == d2.GetHashCode() False
d3.GetHashCode() == d4.GetHashCode() True