-
Notifications
You must be signed in to change notification settings - Fork 748
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
Xcode 13 issue - Enum cases with associated values cannot be marked potentially unavailable with '@available' #471
Comments
Seems like a bug in Swift 5.5 |
I'll keep an eye on this. Hopefully, they'll fix the bug! |
@wtmoose @dneykov There is no activity in the bug report after it was reported or am I missing anything?? |
Hi, do you have any hopes for the bug to be fixed by apple before iOS 15 release? the bug SR-14539 is marked as "Improvement" and without any activity for a long time... |
@racsol I have no idea |
My intuition says that Apple won't fix the bug sooner. What do we do? |
I temporarily downloaded the source. platforms: [ And added it as a Local Package. After that, no error occurred. This is a temporary method. |
Yes that is one hackish solution... |
Asked the author of that change about it: In short, the code needs to be updated not to require @available edit: deleted brainfart |
LOL...I'm not sure his suggestion would qualify as a workaround. |
@eigenl It seems you're trying to suggest a compile-time check but If they're actually not going to fix this, then the only options I see are (a) make a breaking API change in SwiftUI or (b) stop supporting iOS 12 and below. I'm inclined to take option (b). |
Yeah, sorry for the brainfart. Removed it. Another passable solution would be
and casting the associated value to UIWindowScene where needed (just one location in This does remove compile-time guarantee but requires no changes to applications and is the smallest change that could be made to fix it I believe. Dropping iOS 12 is certainly an option, but poses a problem for application developers where decisions regarding minimum targets are out of their hands. |
I reported the same issue in https://bugs.swift.org/browse/SR-14878 and that was just closed as "works as designed". Bummer. |
Any plans on fixing this issue? It seems that this will not be fixed in the swift project.... |
Can we go with this solution? This seems to be optimal. @wtmoose |
A quick fix using Version 10 will revert back to |
Any update on this? |
We tried the latest version and still saw the same issue. The quick fix mentioned by @wtmoose worked. I may have missed something here but why could you make that as the official fix? Also some apps still support iOS 12 so dropping iOS 12 is not desired. |
I submitted PR to solve this issue. Please check it out! |
Looks like the issue is solved with Xcode 13 RC. |
Woah, nice! I'll take a look when I get a chance to install the new build |
@rizwan95 same issues in Xcode 13 RC too |
Any update on fixing this issue? |
@bogartpi the issue is fixed on branch 9.0.4. Does anyone know the released date of 9.0.4? |
Please, release fix. We really need it. That is our single library that can't be build in Xcode 13. |
@rizwan95 9.0.4 released. Thanks! |
Thanks a lot @wtmoose! |
When we try to build SwiftMessages with Xcode 13 beta, the following error is being thrown:
Enum cases with associated values cannot be marked potentially unavailable with '@available'
The text was updated successfully, but these errors were encountered: