I don’t think this is true. As far as I know, Task
's actor context inheritance is strictly lexical, i.e. it only depends on the annotations of the enclosing function (and enclosing type) at the call site, not from where that function has been called.
In other words, we know that the Task { … }
in @mattie’s example does not inherit any actor isolation and thus runs on the global concurrent executor, because neither the containing function nor the enclosing class are annotated with a global actor).
Source: @Douglas_Gregor in SE-0304 (4th review): Structured Concurrency - #36 by Douglas_Gregor ("It's the lexical context.") (This was during the concurrency review process, but I don't believe the rules changed later.)