Skip to content

Commit

Permalink
feat: ban async void
Browse files Browse the repository at this point in the history
  • Loading branch information
ascott18 committed Jun 19, 2024
1 parent e0a6572 commit e6453fe
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/IntelliTect.Coalesce/Validation/ValidateContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,11 @@ public static ValidationHelper Validate(ReflectionRepository repository)

if (method.IsClientMethod)
{
if (method is SymbolMethodViewModel smvm)
{
assert.IsFalse(smvm.Symbol.IsAsync && method.ReturnType.IsVoid, "Async methods must not return void.");
}

if (method.Name != method.NameWithoutAsync)
{
// If the name and name w/o async are different, this method has "Async" at the end.
Expand Down

0 comments on commit e6453fe

Please sign in to comment.