You are correct that this is an exception. Both void
and async Task
methods have the effective return type of void
, and doesn't need a return
statement. This is specified in the language spec:
(emphasis mine)
The effective return type of a method is void
if the return type is
void
, or if the method is async
and the return type is
System.Threading.Tasks.Task
. Otherwise, the effective return type of
a non-async method is its return type, and the effective return type
of an async
method with return type System.Threading.Tasks.Task<T>
is T
.
When the effective return type of a method is void
and the method
has a block body, return statements (§12.10.5) in the block shall not
specify an expression. If execution of the block of a void method
completes normally (that is, control flows off the end of the method
body), that method simply returns to its caller.
When the effective return type of a method is not void and the method
has a block body, each return statement in that method’s body shall
specify an expression that is implicitly convertible to the effective
return type. The endpoint of the method body of a value-returning
method shall not be reachable.
And thinking about it intuitively, even if they wanted to design this so that you must return an instance of Task
, what Task
would you return? There is nothing that makes sense to return! The task that an async method returns is supposed to be representing the asynchronous operations that it carries out.
What actually happens is, some compiler magic turns the code in your method body into a Task
, and make your method return that instead. See also: How does async works in C#?