This is tricky. My best guess is that translationTask(_:action:) is missing all the magic concurrency decorations required to make this work nicely. To get this to build right now you can mark the closure as sendable, like so: .translationTask(configuration) { @Sendable session in do { try await session.prepareTranslation() } catch { // Handle any errors. } } This compiles in Xcode 26.1 using the Swift 6 language mode and: Approachable Concurrency enabled Default Actor Isolation set to MainActor Note I’m using prepareTranslation() in my examples because it’s simpler, and that makes it easier to focus on the core issue. The drawback to this is that you can no longer access main-actor-isolated state from the closure. You can work around that using MainActor.run(…): try await session.prepareTranslation() … no isolation … await MainActor.run { … main-actor isolated … } Clearly this is less than ideal and I encourage you to file a bug against… actually, I think it’d be best to file a bug against the Trans
Topic:
App & System Services
SubTopic:
General
Tags: