-
Notifications
You must be signed in to change notification settings - Fork 730
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
Generated Models Will fail to compile on Xcode 15 if you enable ExistentialAny compiler flag #3205
Comments
Thanks for bringing this to our attention. We should just add the any keyword to all of these files. The existential any is going to become a requirement in Swift 6, it’s just suggested for now. We should get ahead of the game and add it. In fact, we should actually just turn the |
@AnthonyMDev any updates on this? Swift team just announced that swift 5.10 is the last swift 5.x.x release. And that the swift 6 release branch is being cut in march So I suspect swift 6 will be launching with Xcode 16 in September. |
We had made a mistake in our setup when we were trying to reproduce this before. Just took another look at it today, and I see the issue now. We've bumped up the priority on this, and we'll make sure to get this done before it officially launches in Xcode 16. If you'd like to see it happen earlier than that, we would be happy to accept a PR from you to contribute the fixes. If you want to make a contribution, I'd be happy to chat with you about what parts of the code need changes in order to make a suitable PR for this. |
Great! Thanks for the update. I'm not in too much of a rush right now. I'm still in the process of making the rest of our codebase compliant with the other Swift 6 changes. If this becomes a blocker in future I can try and take a crack at it. |
Adding a note here that it looks like |
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. |
Summary
if you add the following flag to
Other Swift Flags
on Xcode 15, generated models will fail to compile:-enable-upcoming-feature ExistentialAny
They all seem to be failing for the same reason(s):
Use of protocol 'ParentType' as a type must be written 'any ParentType'
Use of protocol 'Error' as a type must be written 'any Error'
Should add a codegen option to enable existential any for generated protocols. Or perhaps this should be the default, and a codegen config item should exist for older swift versions.
Version
1.3.0
Steps to reproduce the behavior
in your app build settings, add the following items to
Other Swift Flags
:-enable-upcoming-feature
ExistentialAny
run code gen
try to compile app.
Logs
No response
Anything else?
Enabling compiler flags for upcoming swift 6 features was recently added in swift 5.8. More details here: https://github.com/apple/swift-evolution/blob/main/proposals/0362-piecemeal-future-features.md
Strangely enough, this issue SHOULD happen on Xcode 14.3 and up, but it only seems to happen on Xcode 15 beta.
The text was updated successfully, but these errors were encountered: