Skip to content

[ARM32] Different HashCode on the same virtual method #8671

Closed
dotnet/coreclr
#13513
@myroot

Description

@myroot

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions