Jumped from the quoted thread.
As is, Task
APIs, e.g. Task.isCancelled
requires the caller to be an async function, but Continuation
is used only on non-async function.
AFAICT, to allow the Task
-related usage in continuation block, we need to either
- Make
Task
API works on any non-async function, or - Provide
Task.Handle
to the continuation block, - Copy all
Task
functionality ontoUnsafeContinuation
, turn them into non-async version (since we now know whichTask
it is referring to).