Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 12, 2025

Adds test cases validating that Task and ValueTask<int> returning methods work correctly with __arglist when invoked both directly and via await.

Test coverage:

  • Direct calls to methods with __arglist that return Task/ValueTask
  • Await operator with methods using __arglist that return Task/ValueTask
  • Validation that fixed and variable arguments are correctly passed through when calling Task/ValueTask-returning methods
[MethodImpl(MethodImplOptions.NoInlining)]
private static Task TaskWithArglist(int fixedArg, __arglist)
{
    ArgIterator args = new ArgIterator(__arglist);
    int arg1 = __refvalue(args.GetNextArg(), int);
    int arg2 = __refvalue(args.GetNextArg(), int);
    // Validate args...
    
    return Task.CompletedTask;
}

// Test both direct call and await
TaskWithArglist(42, __arglist(100, 200)).Wait();
await TaskWithArglist(42, __arglist(100, 200));

Files added:

  • src/tests/async/varargs/varargs.cs - Test implementation
  • src/tests/async/varargs/varargs.csproj - Project file

Note: The methods with __arglist are not async themselves - they are synchronous methods that return completed Task or ValueTask<int> values.

Original prompt

This section details on the original issue you should resolve

<issue_title>[RuntimeAsync] Add a testcase for Task-returning methods that use __arglst</issue_title>
<issue_description>We need to add a testcase under src\tests\async\varargs .
The testcase should contain scenarios validating that both direct calls and await operator work correctly with methods that use __arglist feature in cases when the methods return:

  • Task
  • ValueTask<int>

</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Add testcase for Task-returning methods using __arglist Add test coverage for async methods with __arglist Dec 12, 2025
Copilot AI requested a review from VSadov December 12, 2025 18:33
@VSadov
Copy link
Member

VSadov commented Dec 12, 2025

@copilot the methods with __arglist do not need to be async themselves. Just returning a completed Task or ValueTask<int> is sufficient.

Copy link
Contributor Author

Copilot AI commented Dec 12, 2025

@copilot the methods with __arglist do not need to be async themselves. Just returning a completed Task or ValueTask<int> is sufficient.

Updated in e52ac733. The methods with __arglist now return completed Task.CompletedTask and ValueTask without being async.

Copilot AI changed the title Add test coverage for async methods with __arglist Add test coverage for Task/ValueTask-returning methods with __arglist Dec 12, 2025
@VSadov VSadov force-pushed the copilot/add-testcase-for-arglist branch from 3258f1f to 1e36562 Compare December 12, 2025 22:45
@VSadov VSadov force-pushed the copilot/add-testcase-for-arglist branch from ba9f658 to 835bb64 Compare December 13, 2025 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[RuntimeAsync] Add a testcase for Task-returning methods that use __arglst

2 participants