Skip to content
Merged
Changes from all commits
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
14 changes: 14 additions & 0 deletions src/tests/nativeaot/SmokeTests/UnitTests/Generics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ internal static int Run()
Test104913Regression.Run();
Test105397Regression.Run();
Test105880Regression.Run();
Test115442Regression.Run();
TestInvokeMemberCornerCaseInGenerics.Run();
TestRefAny.Run();
TestNullableCasting.Run();
Expand Down Expand Up @@ -3685,6 +3686,19 @@ public static void Run()
}
}

class Test115442Regression
{
public readonly struct TypeBuilder<T1, T2>
{
Comment on lines +3689 to +3692
Copy link
Preview

Copilot AI May 21, 2025

Choose a reason for hiding this comment

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

Consider adding a comment describing the purpose of this regression test (e.g., verifying reflection invocation on generic methods with tuple-based type parameters) to improve maintainability and future clarity.

Suggested change
class Test115442Regression
{
public readonly struct TypeBuilder<T1, T2>
{
// Regression test for issue 115442
// Verifies that reflection invocation works correctly on a generic method
// with tuple-based type parameters.
class Test115442Regression
{
public readonly struct TypeBuilder<T1, T2>

Copilot uses AI. Check for mistakes.

public TypeBuilder<(T1, T2), T3> Add<T3>() => default;
}

public static void Run()
{
typeof(TypeBuilder<int, int>).GetMethod("Add").MakeGenericMethod(typeof(int)).Invoke(default(TypeBuilder<int, int>), []);
}
}

class TestInvokeMemberCornerCaseInGenerics
{
class Generic<T>
Expand Down