Skip to content

Add Swift 6 compatibility for async function code generation#362

Merged
chinedufn merged 2 commits into
chinedufn:masterfrom
Choochmeque:swift-6-compatibility
Jan 6, 2026
Merged

Add Swift 6 compatibility for async function code generation#362
chinedufn merged 2 commits into
chinedufn:masterfrom
Choochmeque:swift-6-compatibility

Conversation

@Choochmeque

@Choochmeque Choochmeque commented Dec 23, 2025

Copy link
Copy Markdown
Contributor

Add Swift 6 strict concurrency compatibility for generated async function code
Add @MainActor to test classes using XCTContext.runActivity
Add CI matrix to test with both Swift 5.0 and Swift 6.0

@Choochmeque

Choochmeque commented Dec 23, 2025

Copy link
Copy Markdown
Contributor Author

Hi @chinedufn,
generated async swift code was not compiling with swift 6. This patch should fix it.
Could you please review it when you have time.
Also, could you please make a new release after merge this PR?

@Choochmeque

Copy link
Copy Markdown
Contributor Author

Hi @chinedufn,
any updates on this PR?

@chinedufn chinedufn left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good thanks. Just one minor piece of feedback about making it clear that if Swift 5 ever becomes too difficult to maintain we can remove it from the test matrix.

timeout-minutes: 30
strategy:
matrix:
swift_version: ['5.0', '6.0']

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, our minimum support Swift version is 6.0, so if 5.0 ever causes problems we can remove it

swift-bridge/README.md

Lines 170 to 173 in 82b0885

## Minimum Supported Swift Version (MSSV)
`swift-bridge` currently guarantees that the Swift code that it generates will work on Swift `6.0` and later.
This is known the project's "Minimum Supported Swift Version" (MSSV).

Let's leave leave a comment here in this test.yml. Something like:

# NOTE: As explained in `README.md`, the minimum supported Swift version is currently `6.0`.
#   If supporting `5.0` ever becomes difficult we can consider removing it from the test matrix.

"#
}

/// A wrapper type that makes any value Sendable for use in Task closures.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the clear documentation about safety.

@chinedufn chinedufn merged commit ea55b2a into chinedufn:master Jan 6, 2026
6 checks passed
@chinedufn

Copy link
Copy Markdown
Owner

Published as 0.1.59 https://crates.io/crates/swift-bridge/0.1.59

@Choochmeque Choochmeque deleted the swift-6-compatibility branch January 6, 2026 15:00
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