Skip to content

Commit

Permalink
Update RMethodInfo RConstructorInfo Equals override to fix CI test fa…
Browse files Browse the repository at this point in the history
…ilures
  • Loading branch information
buyaa-n committed Aug 3, 2022
1 parent 8ee9566 commit d4d961c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,11 @@ public override string ToString()
}

public override bool Equals(object? obj) =>
obj is RuntimeConstructorInfo ci && m_handle == ci.m_handle;
ReferenceEquals(this, obj) ||
(MetadataUpdater.IsSupported &&
obj is RuntimeConstructorInfo ci &&
MetadataToken == ci.MetadataToken &&
m_declaringType.Equals(ci.m_declaringType));

public override int GetHashCode() => RuntimeHelpers.GetHashCodeOfPtr(m_handle);
#endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,12 @@ public override string ToString()

public override int GetHashCode() => RuntimeHelpers.GetHashCodeOfPtr(m_handle);

public override bool Equals(object? obj)
{
return obj is RuntimeMethodInfo m && m_handle == m.m_handle;
}
public override bool Equals(object? obj) =>
ReferenceEquals(this, obj) ||
(MetadataUpdater.IsSupported &&
obj is RuntimeMethodInfo m &&
m.MetadataToken == MetadataToken &&
m_declaringType.Equals(m.m_declaringType));
#endregion

#region ICustomAttributeProvider
Expand Down

0 comments on commit d4d961c

Please sign in to comment.