Detect implicit conversion of async delegates
Open
Area-Analyzers
Feature Request
- Dominant language
- C#
- Stars
- 3.5k
- Forks
- 294
- Avg merge
- 2h 30m
- Merged PRs (30d)
- 4
Description
To complement [CS4014](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-messages/cs4014) that detects `async` calls not `await`'ed, it could be nice to have an analyzer to detect implicit conversions from async delegates to sync ones.
```csharp
async Task FooAsync(Func func)
{
await Task.Delay(0);
func(); // the async delegate is not await'ed!
}
Task BarAsync(Func func)
{
return FooAsync(func); // implicit conversion to Func
}
```
It's not always easily detectable using Intellisense

Contributor guide
Assessment
This issue has not been assessed yet.