You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First start by using .parse_args()? to parse a bunch of FunctionAttr using a new type wrapper struct RawFuncAttrs(syn::punctuated::Punctuated::<FunctionAttr, syn::Token![,]>);
Then combine them all using something like: FunctionAttributes::from_raw(attributes: &[RawFuncAttrs]).
Potential Solution 2 - Make the user specify all attributes together
Don't allow multiple separate #[swift_bridge(..)] attributes and instead make the user say #[swift_bridge(init, associated_to = Foo)] if they want to express multiple properties.
Potential Solution 3 - ...
Trying to quickly open this issue and go do something else so I didn't think of all possible solutions.
The text was updated successfully, but these errors were encountered:
If two
#[swift_bridge(..)]
attributes are used on the same funtion the first one will get ignored.This is ignoring of the first
#[swift_bridge(..)]
attribute is happening hereswift-bridge/crates/swift-bridge-ir/src/parse/parse_extern_mod.rs
Lines 97 to 102 in 1b797f6
Potential Solutions
Potential Solution 1 - Merge function attributes
First start by using
.parse_args()?
to parse a bunch ofFunctionAttr
using a new type wrapperstruct RawFuncAttrs(syn::punctuated::Punctuated::<FunctionAttr, syn::Token![,]>)
;Then combine them all using something like:
FunctionAttributes::from_raw(attributes: &[RawFuncAttrs])
.swift-bridge/crates/swift-bridge-ir/src/parse/parse_extern_mod/function_attributes.rs
Lines 67 to 68 in 1b797f6
RawFuncAttrs
would look similar to thisswift-bridge/crates/swift-bridge-ir/src/parse/parse_extern_mod/function_attributes.rs
Lines 63 to 76 in 1b797f6
Potential Solution 2 - Make the user specify all attributes together
Don't allow multiple separate
#[swift_bridge(..)]
attributes and instead make the user say#[swift_bridge(init, associated_to = Foo)]
if they want to express multiple properties.Potential Solution 3 - ...
Trying to quickly open this issue and go do something else so I didn't think of all possible solutions.
The text was updated successfully, but these errors were encountered: