AsyncFixer icon indicating copy to clipboard operation
AsyncFixer copied to clipboard

Can this be added as a potential misuse of async?

Open dex3r opened this issue 4 years ago • 1 comments

Take a look at a SO question I have asked: https://stackoverflow.com/questions/65891357/is-there-a-way-to-warn-about-an-unawaited-tasks

Someone suggested this package, however it does not cover such case.

Is this something that can potentially be added to AsyncFixer?

dex3r avatar Jan 25 '21 20:01 dex3r

Yes, I can implement such an analyzer.

There is a built-in one to detect those cases under methods with async modifier. You will see the following warning if you add async to your Use method in the sample:

CS4014: Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call.

semihokur avatar Jan 27 '21 06:01 semihokur