diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeConstructorInfo.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeConstructorInfo.CoreCLR.cs index b9145526273a2..4981fbae094b5 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeConstructorInfo.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeConstructorInfo.CoreCLR.cs @@ -121,9 +121,9 @@ public override string ToString() } public override bool Equals(object? obj) => - obj is RuntimeConstructorInfo ci && m_handle == ci.m_handle; + obj is RuntimeConstructorInfo ci && m_handle == ci.m_handle && ReferenceEquals(m_declaringType, ci.m_declaringType); - public override int GetHashCode() => RuntimeHelpers.GetHashCodeOfPtr(m_handle); + public override int GetHashCode() => HashCode.Combine(RuntimeHelpers.GetHashCodeOfPtr(m_handle), m_declaringType.GetHashCode()); #endregion #region ICustomAttributeProvider