Skip to content

Conversation

@petterh
Copy link
Contributor

@petterh petterh commented Jul 28, 2025

An async action that returns an int will use Command.SetAction(Func<ParseResult, Task>). This method silently eats the int and returns 0. This can be confusing, especially for someone converting from the old to the new API.

This PR adds Command.Setaction(Func<ParseResult, Task<int>>), so that the overloads without a CancellationToken are aligned with the methods with a CancellationToken.

Related: #2562

@petterh petterh force-pushed the petterh/issue-2634/set-action-fix branch 2 times, most recently from a21dc61 to 359c5d2 Compare July 28, 2025 11:46
@petterh petterh force-pushed the petterh/issue-2634/set-action-fix branch from 359c5d2 to 0d1cc49 Compare July 28, 2025 11:57
@jonsequitur jonsequitur merged commit 0a63bad into dotnet:main Jul 28, 2025
10 checks passed
@petterh petterh deleted the petterh/issue-2634/set-action-fix branch July 28, 2025 21:37
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.

2 participants