Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Equals overload logic for some methods of an array created using MLC #60894

Merged
merged 2 commits into from
Oct 28, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public sealed override bool Equals([NotNullWhen(true)] object? obj)
if (!(obj is RoSyntheticMethod other))
return false;

if (DeclaringType != other.DeclaringType)
if (ReturnType != other.ReturnType)
return false;

if (_uniquifier != other._uniquifier)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,23 @@ public static void TestArraySetMethod()
return;
}

[Fact]
static void TestArrayMethodsGetSetAddressAreNotEquals()
{
void test(Type type)
{
var v1 = type.GetMethod("Get");
var v2 = type.GetMethod("Set");
var v3 = type.GetMethod("Address");
Assert.NotEqual(v1, v2);
Assert.NotEqual(v1, v3);
Assert.NotEqual(v2, v3);
}

test(typeof(int[]));
test((typeof(int[])).Project());
}

buyaa-n marked this conversation as resolved.
Show resolved Hide resolved
[Fact]
public static void TestArrayAddressMethod()
{
Expand Down