SpacetimeDB
SpacetimeDB copied to clipboard
Rust bindings-macro: either reject or generate idents for reducer arguments with non-ident pattern bindings
The following reducer should either be a macro-expand-time error, or result in a valid ModuleDef with some valid, locally-unique Identifiers as the argument names:
#[derive(SpacetimeType)]
struct SomeProduct {
a: i32,
b: i32,
}
#[reducer]
fn foo(_: &ReducerContext, _: i32, SomeProduct { a, b }: SomeProduct) {
log::info!("{}", a + b);
}
Bonus points: add the above as a test, including valid SDK codegen and client compilation.