public async void SaveOrder(Order order)
{
await _repository.InsertAsync(order);
await _bus.PublishAsync(new OrderSaved(order.Id));
}Deterministic line match on masked source: flags `async void Name(` declarations.
An `async void` method. Callers cannot await it, and an exception thrown inside it escapes every caller's try/catch and can crash the process.
Each example shows the exact code shape the rule is looking for, then the smallest version that keeps the intent without hiding risk or adding noise.
public async void SaveOrder(Order order)
{
await _repository.InsertAsync(order);
await _bus.PublishAsync(new OrderSaved(order.Id));
}Deterministic line match on masked source: flags `async void Name(` declarations.
public async Task SaveOrderAsync(Order order)
{
await _repository.InsertAsync(order);
await _bus.PublishAsync(new OrderSaved(order.Id));
}Return `Task` (or `Task<T>`) so callers can await and observe failures. If it must be `void` for an event, make sure the body cannot throw.
Agents mark a method `async` to use `await` inside and leave the return type as `void` because nothing is returned. The compiler accepts it without complaint.
ai-slop/csharp-async-void
ai-slop
Deterministic line match on masked source: flags `async void Name(` declarations.
Event handlers are not flagged: names starting with `On` and a capital letter, ending in `Handler`, or containing an underscore (such as `button1_Click`), and signatures that mention `EventArgs`.
Part of aislop's C# rule set. First-class C# support, including C#-specific AI-slop rules, arrived in aislop v0.14.1.