After reading more docs about this I'm still not sure why my public structs are not implicitly Sendable.
The proposal says:
and for frozen public structs and enums, the Sendable conformance is implicitly provided
Then reading the frozen documentation:
When the compiler isn’t in library evolution mode, all structures and enumerations are implicitly frozen, and this attribute is ignored.
And from Swift docs:
Library evolution support is turned off by default. Frameworks that are always built and distributed together, such as Swift Package Manager packages or binary frameworks that are internal to your app, should not be built with library evolution support.
And checking in Xcode I don't have BUILD_LIBRARY_FOR_DISTRIBUTION enabled either.
So given all of this I deduce that: My library has library evolution off -> so public structs are frozen implicitly -> so Sendable conformance should be implicit.
Is this chain of deductions wrong?
Or the other issue I can think of is that I still don't fully understand how SPM plays into this? Maybe although Xcode doesn't have it enabled the fact that I use a local SPM package to make libraries than then are imported into Xcode some how makes it a different resilience domain and thus disabling the implicit frozen?
Here is an example of the code I'm trying:
I would expect PublicModel to not have a warning since there is no library evolution enabled (in theory).
This code example is compiling a library module (library scheme in Xcode) from SPM.
I'm using Xcode 14.2 and the target in SPM has concurrency checks enabled:
SwiftSetting.unsafeFlags([
"-Xfrontend", "-strict-concurrency=complete",
"-Xfrontend", "-warn-concurrency",
"-Xfrontend", "-enable-actor-data-race-checks",
])