I don't want to derail this thread, but I'm getting increasingly confused by what these terms mean. What exactly makes UnsafePointer
have "reference semantics"? Why would reference semantics preclude "sendability"?
Does ManagedAtomic<Int>
in the swift-atomics package have "reference semantics"? If so, does that mean it should not be Sendable
? (It is safely transferrable across concurrency domains.)
Does this extension give Int
"reference semantics"? Is it in conflict with its Sendable
conformance?
var storage: [String] = ...
extension Int {
var pointee: String {
get { storage[self] }
set { storage[self] = newValue }
}
}
(How can we possibly infer sendability by just looking at a type's stored properties, without analyzing its operations?)