-
Notifications
You must be signed in to change notification settings - Fork 6
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
Ability to subclass NetworkDataResourceService broken in Swift 5.2 #84
Comments
I left a comment on your post with an explanation. Please let me know (on the forums) if you have any other questions about the change. You can continue to use Swift 5.1 though. |
I have the same issue any idea? +1 |
Your options are:
|
I'm using a swift 5.1 but still, have a same issue , do can you see my code? |
To clarify, if you’re doing the above then the problem is with your code rather than the compiler. My suggestion to stay on Swift 5.1 is only temporary (while you investigate other approaches), the right way to fix the problem is to rewrite the code in a way that doesn’t break Liskov. I implemented the changes in 5.2, so it’s not possible for the code to stop compiling in 5.1, so I assume you have a different but related problem? If you could show your code then I may be able to offer some suggestions. |
Thank you for replay My question: https://stackoverflow.com/q/60710024/9315978 |
Seems like some sort of alignment issue (at least in debug mode), in release mode it runs fine on Swift 5.1. Anyway, it won't work on 5.2 because the code isn't correct. You're adding a new |
@theblixguy thank you so much I fixed it using a check the types |
In Swift 5.2 there is a change that prevents changing the generic requirements in an overridden method. Which completely breaks our use of subclassing NetworkDataResourceService.
https://forums.swift.org/t/method-override-with-a-generic-signature-with-requirements-not-imposed-by-the-base-method/33593
Is there any ideas on how to resolve this?
The text was updated successfully, but these errors were encountered: