Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apollo code-gen fails to compile on Xcode 15.3 with StrictConcurrency enabled #3348

Closed
dfed opened this issue Mar 6, 2024 · 2 comments
Closed
Labels
bug Generally incorrect behavior needs investigation

Comments

@dfed
Copy link

dfed commented Mar 6, 2024

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

@dfed dfed added bug Generally incorrect behavior needs investigation labels Mar 6, 2024
@AnthonyMDev
Copy link
Contributor

We're going to move #3291 from 2.0 back into 1.x and add it to our current roadmap. Closing this as duplicate. Thank you for the feedback and suggestion!

@AnthonyMDev AnthonyMDev closed this as not planned Won't fix, can't repro, duplicate, stale Mar 8, 2024
Copy link

github-actions bot commented Mar 8, 2024

Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo iOS usage and allow us to serve you better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Generally incorrect behavior needs investigation
Projects
None yet
Development

No branches or pull requests

2 participants