Skip to content
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

Add Sendable to Swift Templates #2318

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

martinmose
Copy link
Contributor

Hey,

This PR addresses Issue #2274 by marking all generated Uniffi classes in Swift as @unchecked Sendable. This change ensures compatibility with Swift 6 and allows Uniffi-generated classes to be used in concurrent contexts without triggering Sendable-related compiler errors.

The addition of @unchecked Sendable is backward-compatible with iOS 8.0 and above, so it should be good to go?

I’ve tested and verified that my Swift packages and project now work correctly with Swift 6. Here is the generated output I’m getting:

public protocol TicketHandlerProtocol: Sendable, AnyObject {
open class TicketHandler:
    @unchecked Sendable, TicketHandlerProtocol
{

Let me know if there’s anything I missed or if there’s anything else you’d like adjusted. Thanks!

@martinmose martinmose requested a review from a team as a code owner November 17, 2024 23:11
@martinmose martinmose requested review from gruberb and removed request for a team November 17, 2024 23:11
@mhammond
Copy link
Member

lgtm, but not to the tests :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants