Compare AsyncFixer05 and AsyncFixer06
mainBoth rules detect task type mismatches but address different structural problems:
| Aspect | AsyncFixer05 | AsyncFixer06 |
|---|---|---|
| Pattern | Task<Task<T>> (nested task) | Task<T> → Task (implicit conversion) |
| Problem | Awaiting outer task doesn't wait for inner task | Result value T is silently discarded |
| Context | TaskFactory.StartNew with async lambdas | Lambda assignments to Func<Task> |
| Fix | Use Unwrap() or Task.Run() | Change delegate type to Func<Task<T>> |
// AsyncFixer05 - nested task: Task<Task>
Task task = Task.Factory.StartNew(() => DelayAsync());
// AsyncFixer06 - result discarded: Task<string> converted to Task
Func<Task> fn = () => GetDataAsync(); // GetDataAsync returns Task<string>