`@isolated(any)` function types

The motivation is to not over-interpret Task {} in an isolated context, especially in a main actor context. (This really is specific to Task {}[1], since nothing else in the language makes sendable closures inherit isolation this way.) Forcing the closure to start on its formal isolation even if it, say, immediately makes a network request means that that request can't start until the actor has finished everything else in its queue. In the case of the main actor, it also adds unnecessary work to an already highly-loaded queue. I don't want Task {} to be a performance footgun.


  1. Well, and any libraries using the same underscored attribute as Task. ↩︎

1 Like