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
structs with const generics in them don't parse or generate properly
Steps to reproduce
I change the default template simple.rs to:
#[flutter_rust_bridge::frb(sync)]// Synchronous mode for simplicity of the demopubfngreet(_name:String) -> Foo<32>{todo!()}#[flutter_rust_bridge::frb(init)]pubfninit_app(){// Default utilities - feel free to customize
flutter_rust_bridge::setup_default_user_utils();}#[derive(Clone,Copy,Debug)]pubstructFoo<constN:usize>{data:[u8;N],}
And then generate doesn't work
Logs
no entry found for key=MirStructIdent(NamespacedName { namespace: Namespace { joined_path: "crate::api::simple" }, name: "Foo" })
thread 'main' panicked at /home/llfourn/.cargo/registry/src/index.crates.io-6f17d22bba15001f/flutter_rust_bridge_codegen-2.7.1/src/library/codegen/ir/mir/ty/structure.rs:36:32:
no entry found for key=MirStructIdent(NamespacedName { namespace: Namespace { joined_path: "crate::api::simple" }, name: "Foo" })
Expected behavior
I would at the very worst expect it to ignore the type and output a warning.
Generated binding code
Stuff looks like this:
impl SseEncode for crate::api::simple::Foo {
// Codec=Sse (Serialization based), see doc to use other codecs
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {}
}
^ it's missing the const generic
OS
No response
Version of flutter_rust_bridge_codegen
flutter_rust_bridge_codegen 2.7.1
Flutter info
Version of clang++
No response
Additional context
No response
The text was updated successfully, but these errors were encountered:
Just as a note I wasn't specifically trying to use a const generics struct, it just happened to be in one library I added to rust_input. I tried doing:
/// flutter_rust_bridge:ignore
on that struct in the library but that didn't work.
Describe the bug
structs with const generics in them don't parse or generate properly
Steps to reproduce
I change the default template
simple.rs
to:And then
generate
doesn't workLogs
Expected behavior
I would at the very worst expect it to ignore the type and output a warning.
Generated binding code
OS
No response
Version of
flutter_rust_bridge_codegen
flutter_rust_bridge_codegen 2.7.1
Flutter info
Version of
clang++
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: