-
Notifications
You must be signed in to change notification settings - Fork 53
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
#[swift_bridge::bridge] macro forces module to be private #252
Comments
Not intentional, we've just been adding things as we need them and you're the first to make note of this. One workaround is to use Supporting this should be easy though if you're interested. Roughly two lines of implementation code + a couple of tests. Here's how one might add support for preserving the module's visibility, in case you or any future person wants to tackle this: Potential SolutionAdd a parsing test where we verify that we can store the module's visibility swift-bridge/crates/swift-bridge-ir/src/parse.rs Lines 164 to 210 in 72e1759
Add a codegen test where we confirm that the module's visibility is preserved in the generated Rust tokens: Perhaps in a swift-bridge/crates/swift-bridge-ir/src/codegen/codegen_tests.rs Lines 30 to 54 in 4fbd30f
Add a field swift-bridge/crates/swift-bridge-ir/src/lib.rs Lines 59 to 60 in b077451
Then set the field during parsing swift-bridge/crates/swift-bridge-ir/src/parse.rs Lines 126 to 127 in 72e1759
Interpolate the visibility here
Verify that tests pass using |
Awesome! I'll try and get a PR open for this soon :) |
I defined a transparent type in one ffi submodule:
and tried to import it in another module:
but saw the following error for this line:
use error:ffi:RuntimeError
:It seems the
#[swift_bridge::bridge]
macro forces its module to be private--is this intentional, or can its private/public status be passed through?The text was updated successfully, but these errors were encountered: