You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// swift-tools-version: 6.2
...
.target(
name: "DefaultActorIsolationPackage",
swiftSettings: [
/// You can add a new `defaultIsolation` Swift setting to any of your SPM targets.
.defaultIsolation(MainActor.self)
]
)
I'm not totally sure about this, as i'm not an expert on those Actors thingy.
Thanks for reporting this! The root cause is that the library was compiled with swift-tools-version:5.0 (Swift 5 language mode), where non-escaping closures don't inherit the caller's actor isolation.
In Swift 6 language mode, non-escaping closure parameters automatically inherit the caller's actor isolation — so bumping swift-tools-version to 6.0 fixes this without any API changes. No overloads or @preconcurrency workarounds needed.
Activity
Fix Swift 6 MainActor isolation by bumping swift-tools-version to 6.0
devxoul commentedon Mar 10, 2026
Thanks for reporting this! The root cause is that the library was compiled with
swift-tools-version:5.0(Swift 5 language mode), where non-escaping closures don't inherit the caller's actor isolation.In Swift 6 language mode, non-escaping closure parameters automatically inherit the caller's actor isolation — so bumping
swift-tools-versionto6.0fixes this without any API changes. No overloads or@preconcurrencyworkarounds needed.PR: #107