Swift 6.2 and requiring Sendable Types #313
Replies: 3 comments
-
|
Ah that's scary.. we have a lot of old code still in our code base and also some classes in our factories are really not meant to be Sendable. Anything we could help with? |
Beta Was this translation helpful? Give feedback.
-
|
My guess is that it's not going to cause much trouble. Sendable conformance does not force library clients to use strict concurrency if they are not ready to move to Swift 6, hence there is no extra code that needs to be written by library clients to conform to Sendable (probably a bunch of warnings will pop up to clients still on Swift 5 mentioning that Sendable conformance will be required once the codebase is moved to Swift 6). |
Beta Was this translation helpful? Give feedback.
-
|
Removed @isolated(any) suggested by #237 after consultation with the Swift team, which was causing several issues with Swift 6.2, including the aforementioned Sensibility requirements. Using @isolated(any) is suggested for closures that are going to cross isolation boundaries, and that should never be the case. Code now appears to work correctly with 6.2 with nonisolated and actor isolated Factorys, in both Xcode 16.4 and 26. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
It's looking as if Swift 6.2 is about to box Factory in and require that all types returned by Factory be Sendable (or @unchecked Sendable.
How much trouble is this going to cause?
Beta Was this translation helpful? Give feedback.
All reactions