-
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
Looking for Suggestions on Fully Supporting Swift 6’s Sendable #28
Comments
Are you using the latest version of main? c053e11 I think this should fix the issue. It's marked as |
Yes I am. The problem is with property wrappers. So I'am afraid Factory won't be able to fix it too: He mentions there is no easy fix, but I'm afraid a fix isn't possible. ![]() There are multiple threads on swift forums about this issue as well: https://forums.swift.org/t/static-property-wrappers-and-strict-concurrency-in-5-10/70116/26 At the moment, the only solution appears to be a Macro. |
Looks like the fix I mentioned above only applies when the property wrapper is used in a struct. I think we should note this down as a current limitation of swift and not try to work around it within the templates. Or wait until the Factory library has a Until that time I'd suggest to go with the manual computed property approach.
Otherwise try any of the suggestions in this thread: pointfreeco/swift-dependencies#204 (reply in thread) Personally I'd make the thing you're using the property wrapper in a struct if possible. Or mark your class |
Okay, we will use your example and hope the proposal gets implemented and merged. Thanks! 🙏🏻 |
I’m exploring ways to fully support Swift 6’s Sendable using a
@UseCase
attribute.Currently, property wrapper are mutable and, therefore, can't conform to Sendable.
To overcome this, I’ve started looking into the use of custom macros.
One idea is to create a macro that would expand:
@UseCase private var getHomeUseCase: GetHomeUseCaseProtocol
to
Using a Swift template, I could generate the corresponding macro package.
The template would look something like this:
The generated macros will look like:
Downsides:
@_exported import
could be used to simplify this.Do you have any suggestions or ideas to improve this approach? Thanks!
The text was updated successfully, but these errors were encountered: