The RC of Xcode 15.3 gives me warnings for generated code when String Concurrence Checking is set to complete:
@available(iOS 17.0, macOS 14.0, tvOS 17.0, watchOS 10.0, *)
extension DeveloperToolsSupport.ColorResource {
/// The "AccentColor" asset catalog color resource.
static let accent = DeveloperToolsSupport.ColorResource(name: "AccentColor", bundle: resourceBundle)
}
The warning:
Static property 'accent' is not concurrency-safe because it is not either conforming to 'Sendable' or isolated to a global actor; this is an error in Swift 6
@jmjauer Is this the code generated by Xcode to access asset catalog resources, or your own generated code? If it's Xcode's you'll want to report it to Apple to see if it can be fixed, and we'll want to notify some people here.
@allevato A better solution would likely be to make the ColorResource (and other resource types, presumably) Sendable, as they're just dumb containers, so that they can be used regardless of actor. These keys are often passed around various contexts before being used in the UI.
Sure, but DeveloperToolsSupport is an Apple SDK framework, so I offered the solution that was more immediately feasible without adding unchecked retroactive conformances.
(Of course, if the code is generated by Xcode, then my suggestion also won't work.)
I don't believe you can edit the code from Xcode's generator (it's a build time generator, like macros, and doesn't put code on disk for the project) anyway. It is cached in DerivedData (Build/Intermediates.noindex/{target}.build/Debug-iphonesimulator/{target}.build/DerivedSources/GeneratedAssetSymbols.swift) so you might be able to copy it out, but this is mostly an Apple problem to fix.
It is generated by Xcode - I was just surprised that an obvious bug that generates a warning for pretty much every project is still in the RC of Xcode.
Have you tried extension DeveloperToolsSupport.ColorResource: @unchecked Sendable {}? You may just be able to fake the system until it stops complaining. It should fine, hopefully these are simple value types.