chinedufn / swift-bridge

swift-bridge facilitates Rust and Swift interop.
https://chinedufn.github.io/swift-bridge
Apache License 2.0
842 stars 62 forks source link

Already_declared causes swift generation to never declare Class #259

Open PrismaPhonic opened 8 months ago

PrismaPhonic commented 8 months ago

I've found when generating a swift package from my rust FFI bindings, that if I use already_declared on a type in a subsequent extern "Rust" block, that the generated code never declares the class initially (it only includes extension)

I can provide some concrete examples but it really is that simple that I'm not sure an example would show anything other than what I just wrote :-P

chinedufn commented 8 months ago

A bit easier to see it as a bridge module than as words. For example, I can't tell if your scenario has 2 bridge modules or one. I'm assuming two, but would prefer not to assume.

So yes please comment with an minimal example bridge module that illustrates the problem.