Skip to content

Conversation

@buyaa-n
Copy link
Contributor

@buyaa-n buyaa-n commented Oct 26, 2021

Fixes #57728
Update Equals overload for RoMethods created by MetadataLoadContext to check ReturnType instead of DeclaringType

@ghost
Copy link

ghost commented Oct 26, 2021

Tagging subscribers to this area: @buyaa-n
See info in area-owners.md if you want to be subscribed.

Issue Details

Fixes #57728
Update Equals overload for RoMethods created by MetadataLoadContext to check ReturnType instead of DeclaringType

Author: buyaa-n
Assignees: -
Labels:

area-System.Reflection.Metadata

Milestone: -

if (!(obj is RoSyntheticMethod other))
return false;

if (DeclaringType != other.DeclaringType)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the current code, is DeclaringType always the same for every RoSyntheticMethod? It should be RoArrayType. In any case, comparing Declaring type as-is makes sense if RoSyntheticMethod is ever used outside of arrays.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes DeclaringType is always same for every RoSyntheticMethod, need to check it as-is for different array types like int[] vs long[]

@buyaa-n buyaa-n merged commit 5613572 into dotnet:main Oct 28, 2021
@buyaa-n buyaa-n deleted the fix-equals branch November 3, 2021 19:11
@ghost ghost locked as resolved and limited conversation to collaborators Dec 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

No open projects

Development

Successfully merging this pull request may close these issues.

Some MethodInfo(s) of array types loaded by MetadataLoadContext are incorrectly evaluated as equal.

2 participants