Factory icon indicating copy to clipboard operation
Factory copied to clipboard

Sendable conformance for `Container`

Open erichoracek opened this issue 11 months ago • 2 comments

With Swift 5.10 released and Swift 6 on the horizon, consumers of Factory would expect Container to conform to Sendable as it is intended to be thread safe. However, since it contains a property of containerManager, it's not possible to mark it as such:

image

Furthermore, when you attempt to conform ContainerManger to sendable, you notice that it has publicly writable properties that are not protected, namely defaultScope but also some other debug ones, so it cannot conform to Sendable either:

image

To satisfy the Sendable contract, ideally Container and ContainerManager would both have Sendable conformances, though this might require an API rethink.

erichoracek avatar Mar 08 '24 19:03 erichoracek