Skip to content

Commit

Permalink
Update RuntimeConstructorInfo Equals, HashCode similarly
Browse files Browse the repository at this point in the history
  • Loading branch information
buyaa-n committed Aug 4, 2022
1 parent ea07c6f commit 06681a8
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 06681a8

Please sign in to comment.