Skip to content

fix(swift): avoid duplicate callback metadata in struct bridges - #2016

Merged
mrousavy merged 1 commit into
v1from
hannojg/fix-swift-struct-callback-metadata-opaque
Oct 28, 2026
Merged

mrousavy merged 1 commit into
v1from
hannojg/fix-swift-struct-callback-metadata-opaque

Conversation

@hannojg

@hannojg hannojg commented Oct 28, 2026

Copy link
Copy Markdown
Member

Two modules exposing the same callback signature in struct fields emit duplicate Swift metadata and fail to compile together. Repro:

This applies the existing opaque method bridge to struct initializers and getters, including their JSI and native C++ converters.

The generated @_spi(NitroCxx) bridge uses UnsafeRawPointer to borrow initializer arguments and UnsafeMutableRawPointer to initialize caller-owned C++ result storage. The regular Swift API stays typed.

This works around swiftlang/swift#93318. Remove the opaque struct bridge once the minimum supported Xcode includes swiftlang/swift#93321.

Restores the original approach from the reverted fix:

@vercel

vercel Bot commented Oct 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
nitro-docs Skipped Skipped Oct 28, 2026 11:03am UTC

Request Review

@hannojg
hannojg marked this pull request as ready for review October 28, 2026 11:03
@hannojg
hannojg requested a review from mrousavy October 28, 2026 11:05
@mrousavy
mrousavy merged commit 69d365f into v1 Oct 28, 2026
15 of 18 checks passed

This branch was previously deployed

1 inactive deployment
Preview — 0104e29c Deployed Oct 28, 2026 by vercel[bot]
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