-
Notifications
You must be signed in to change notification settings - Fork 18
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
Support For Swift 6 Typed Throws #63
Comments
@Kolos65 would you accept contributions for this? I'd be happy to progress this with some guidance as we're keen to embrace Swift 6. Thanks! |
This is not a library issue, swift-syntax 511.x.x cannot parse this new Swift 6 feature and the This can't be fixed until the official realse of swift-syntax 600.x.x which is currently in pre-release phase. |
Regardless, adding support for typed throws will not be trivial, we could start implementing that in the meantime. |
Great context to have on the release, thanks @Kolos65 . Any guidance on how we could start? We're loving our time with Mockable and we're keen to help make it even better where we can. 👍 |
I would start this by first making this work with the above protocol's current expansion (remove the typed throw and copy the |
Added some pre-work in this PR: #64 |
@calebwilson706, @kelvinharron I have finished implementing this feature, can you guys take a quick look by using the feat-add-typed-throws-support branch? |
I'll get back to you asap on this @Kolos65 thank you for providing it! |
@Kolos65 The flow I tried was to update a protocol to use a typed throw and set a module and its test companion target to use Swift 6. When I look at the Do you know what I could be missing here? Instead of creating a new app to test this individually, I'm trying to bring it into our existing app because it would be a real world representation other users would share. Thanks! |
@kelvinharron Can you check if you see:
in the Package.swift of your pulled version? |
@Kolos65 confirmed:
While I can get us to Xcode 16 and iOS 18 easily, I'm not sure how long moving to Swift 6 across the codebase will take. Any thoughts on what I can do to further debug? Keen to help with this ace work you've done (and greatly welcome the removal of MockableTest)! 😃 |
@kelvinharron so there are other modules that still use swift 5 in the project? |
@Kolos65 yes, it's on our list to migrate them all over. I can't promise a timeline on that with other priorities as we move towards our deadline window. Would you prefer to revisit this another time? |
Yeah, I think if you still have some modules that are built with Swift 5 language mode, Mockable won't be compiled with Swift 6. If you get to a point where you can test this in your project, I would love to hear your feedback! I think I will merge this soon anyways. |
We recently updated our project to swift 6 and were looking forward to using typed throws. However, Mockable gives us the following error when adding the error type to the functions on our protocol definitions
Example Code
The text was updated successfully, but these errors were encountered: