I found the answer. It has nothing to do with Task
.
The behavior is defined in SE-0296:
In non-
async
functions, and closures without anyawait
expression, the compiler selects the non-async
overload:
When initializing a new task Task
, we pass in a closure and when there are no await
expressions, the non-async overload of load
will be used.
This was added in an amendment to that proposal.