Avatar
Avatar
Iceman
@swift-6.1.2 -swift-version 6 @MainActor func foo() { Task(executorPreference: globalConcurrentExecutor) { @MainActor in foo() } }
exit status 1 with stderr:<stdin>:2:5: error: sending value of non-Sendable type '@MainActor @Sendable () async -> ()' risks causing data races 1 | @MainActor func foo() { 2 | Task(executorPreference: globalConcurrentExecutor) { @MainActor in | |- error: sending value of non-Sendable type '@MainActor @Sendable () async -> ()' risks causing data races | `- note: Passing main actor-isolated value of non-Sendable type '@MainActor @Sendable () async -> ()' as a 'sending' parameter risks causing races inbetween main actor-isolated uses and uses reachable from the callee 3 | foo() 4 | }