Is there a difference between these two examples?
// func f()
// 1
await Task.runDetached {
f()
}
// 2
async let task = f()
await task
Likewise:
// func g() async
// 3
await g()
// 4
async let task = g()
await task
If examples 3 and 4 behave differently then that concerns me. You should be able to split off the continuation without changing the context in which the function is called.
I would rather forbid example 2 than make 3 and 4 behave differently. I don’t personally see much value in supporting case 2 when case 1 is clearer and seems to meet all the same use cases.