Missing cross-isolation diagnostics?

I believe that bar is eagerly ‘nonisolating’ itself by jumping to the preferred task executor. In the second case the compiler knows that the default task executor is MainActor (which matches the isolation of foo), whereas in the first case the default task executor isn’t necessarily MainActor (depends on the calling context of foo). I believe that this exact situation is one of many that SE-0461 seeks to address, after which both versions of the code should work.

Edit: Whoops, just realised Task { @MainActor in … } doesn’t set task executor preference (duh)