noremac
(Cameron Pulsford)
1
We used to have to mark types as @unchecked Sendable when they couldn't otherwise be proven safe to the compiler via normal means. I believe I read somewhere that we could instead now mark the type as Sendable and then annotate necessary properties as nonisolated(unsafe).
I know this is a bad example but just to illustrate:
final class X {}
struct Foo: Sendable {
nonisolated(unsafe) var _value: X?
}
However, this generates two warnings in Xcode 15.3 with complete concurrency checking enabled.
'nonisolated' is redundant on struct's stored properties; this is an error in Swift 6
Stored property '_value' of 'Sendable'-conforming struct 'Foo' has non-sendable type 'X?'
Did I entirely make this up? Or perhaps I've done something wrong?
2 Likes
I think I saw a bug fix here for this issue
1 Like
noremac
(Cameron Pulsford)
3
Oh nice find! @hborla do you know if there are any plans to back port fixes of this type to a 5.10.x release? Or should we just hold tight for WWDC 