hibernat
(Michael Bernat)
1
This:
struct Content: Sendable {
@State private var x = "xxx"
}
displays the following warning:
Stored property '_x' of 'Sendable'-conforming struct 'Content' has non-sendable type 'State<String>'
However, State conforms to Sendable. At least according to Xcode documentation. Is this a bug? Any other explanation?
Tested on Xcode 15.0 RC, Strict Concurrency Checking: Complete
1 Like
aggie33
2
State does not conform to Sendable.
Actually this is weird; in the Swift Playgrounds documentation it says State does not conform, but in the online documentation it says that it does conform. But seeing as how you're getting this error I assume it does not actually conform to Sendable.
hibernat
(Michael Bernat)
3
Yes, that is very logical conclusion, and also something I was afraid of. So @State is thread-safe, however not Sendable. Not great, not terrible.