apollo-ios
apollo-ios copied to clipboard
Apollo code-gen fails to compile on Xcode 15.3 with StrictConcurrency enabled
Summary
Apollo code-gen does not compile on Xcode 15.3 with concurrency checking set to Strict. static let properties fail to compile with the following error:
Static property 'XXXXX' 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
Version
1.9.0
Steps to reproduce the behavior
Generate Swift with Apollo that generates a static OperationDocument, Interface, Object, or Union
Logs
No response
Anything else?
I was able to get things compiling in my own repo by writing the following extensions:
extension ApolloAPI.OperationDocument: @unchecked Sendable {
// This type is immutable and its properties are also immutable.
}
extension ApolloAPI.Interface: @unchecked Sendable {
// This type is immutable and its properties are also immutable.
}
extension ApolloAPI.Object: @unchecked Sendable {
// This type is immutable and its properties are also immutable.
}
extension ApolloAPI.Union: @unchecked Sendable {
// This type is immutable and its properties are also immutable.
}
Ideally these types would conform to either Sendable or @unchecked Sendable within the Apollo library. This work is likely related to #3291