Open chinedufn opened 2 years ago
We can add a BridgeableType.has_exactly_one_representation() -> bool
method so that our logic works for all types that fit this pattern.
We can add tests to confirm that we elide FFI arguments / return values when there is exactly one representation.
Closed via #178
Still to stop generating the FFI #[repr(C)]
representation when struct is empty. Then we can close this.
Right now if you define a shared struct
We generate an FFI representation that looks something like this:
When passing
SomeStruct
across the FFI boundary, we create and pass a__swift_bridge__SomeStruct
.This is unnecessary since we control both sides of the FFI boundary.
For example ... say you have
We should generate things like:
The same idea would go for function return types.
Benefits