We are in the process of making sure our code is fully Sendable compliant and one thing I'm wondering is if there is a way of having "public/package" types be implicit Sendable without having to write the conformance all the time.
The issue may be related to the "package access control" thread but that one is huge and I'm not sure if it relates to this at all so hence I ask in a separate thread.
The code I'm talking about follows the modern "modularized" app popularized by PointFree. Basically the app target is just a shell for different libraries defined in SPM. In my case I have a single Package with multiple libraries in it. This means that the types in the libraries are public so they can be used on other libraries in the same package, which according to the docs disables implicit conformance:
Many structs and enums satisfy the requirements of
Sendable
, and having to explicitly write out ": Sendable
" for every such type can feel like boilerplate. For non-public structs and enums that are also not@usableFromInline
, and for frozen public structs and enums, theSendable
conformance is implicitly provided
Given this structure, and what the Sendable proposal says, is there a way to tell the libraries that their types should be implicitly Sendable? I'm just trying to avoid the boilerplate of annotating each type. I'm not too experienced with library evolution but maybe using frozen helps? Although that would mean I have to annotate every type anyway right?
I know it may be a weird ask, and if I need to annotate all types is not a big deal, at this point I'm just curious. Any help is welcomed, thanks :)