You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Do not call Task.WaitAll with a single argument #33807
I have a working analyzer for this as well, if this is ready to implement. #33806 is very similar, my analyzer would offer a great basis for that issue.
usingSystem.Threading.Tasks;namespaceMyNamespace{classSample{publicstaticvoidMain(){Tasktask=...;// Instead of thisTask.WaitAll(task);// Suggest thistask.Wait();// Instead of thisTask.WaitAll(GetTask());// Suggest thisGetTask().Wait();}staticTaskGetTask(){return...;}}}
This analyzer should not affect any of the other WaitAll overloads, because they take a Task[]. Only this overload, which takes a params Task[] task would be affected.
This analyzer should also have a fixer.
Suggested severity: Info.
Suggested milestone if approved: 6.0 (seems simple to address).
Activity
jeffhandley commentedon Mar 21, 2020
Estimates:
Mrnikbobjeff commentedon Aug 30, 2020
I have a working analyzer for this as well, if this is ready to implement. #33806 is very similar, my analyzer would offer a great basis for that issue.
carlossanlop commentedon Oct 30, 2020
Here is a usage example:
WaitAlloverloads, because they take aTask[]. Only this overload, which takes aparams Task[] taskwould be affected.Questions
WhenAll) into a single rule ID?terrajobst commentedon Feb 4, 2021
Video
ryzngard commentedon Feb 5, 2021
I'll take this and #33806
carlossanlop commentedon Feb 5, 2021
It's yours, @ryzngard. Thanks for your help! Let us know if you have any questions.
stephentoub commentedon Jul 13, 2021
This was implemented as CA1842/1843. Thanks!