Closed smokytheangel0 closed 1 year ago
Hi! Thanks for opening your first issue here! :smile:
Firstly, try Vec<Box<Item>>
Whats weird is this same function compiled fine earlier, the only changes between working and not was some field name refactors in an unrelated file.
Could you please provide a minimal reproducible sample? In other words, a almost-blank repository with few lines of code that reproduce the bug.
I guess by creating this min reproducible sample you will find out the cause.
You are quick, sir. I will do that and let you know.
I have a minimal example which gives the same error, https://github.com/smokytheangel0/frb_minimal.
I have not created a repo in a long time, so if I did something wrong please let me know. Not sure how to diff this and the flutter_rust_bridge_template starting file, so I hope you know. I had to modify the just file for the minimal because I have few brain cells left.
Rough idea: Maybe the Item
forget to implement IntoDartExceptPrimitive
, so https://github.com/sunshine-protocol/allo-isolate/blob/ba1d3ee8e6d12b37d8ca63c1c13a8ff563aa5625/src/into_dart.rs#L242 does not auto apply.
Please ensure you have used the latest:
And feel free to PR!
ok thanks for the internal info, I will try and manually implement IntoDartExceptPrimative and I will try and install a newer version of codegen from cargo. I will look at the codegen and see if I can figure out how to make it do automagically if I figure out a solution in my code.
try and manually implement IntoDartExceptPrimative
That should be done automatically. But anyway manually adding it can quickly test whether it is the cause.
I will look at the codegen and see if I can figure out how to make it do automagically if I figure out a solution in my code.
Take your time and looking forward to your PR!
after looking through the codegen, I can see where it adds the impl support::IntoDartExceptPrimitive to the generated_bridge lines in impl_intodart() in ty_enum.rs and the format isn't conditional, maybe later the last line is clobbered by a successive process, but I haven't gotten there yet.
its also missing the newline (or String::new()) in the generated output, so the very next thing in generated_bridge lines is the next item presumably from the map operation near the invocation of generate_impl_intodart() in mod.rs. I hope I am understanding this right.
maybe later the last line is clobbered by a successive process, but I haven't gotten there yet.
IIRC nothing is removed once generated, in frb.
https://github.com/fzyzcjy/flutter_rust_bridge/search?q=IntoDartExceptPrimitive Guess you are right
its also missing the newline (or String::new()) in the generated output
Btw we do run code formatter after generation so not sure whether your "missing newline" comes from this
Thanks
You are welcome!
The only thing I have found so far is an explicit newline in the format when structs are generated, but no such newline in the enum version of the format. How do I use my local codegen for a bridge_template project, when I have previously installed it through cargo?
How do I use my local codegen for a bridge_template project
It is nothing but a rust binary so just cargo run etc
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new issue.
Describe the bug
I am using the bridge template, started at v1.41.3, and after encountering the issue I updated to v1.43.0, and from flutter 3.0 to flutter 3.3. I have been using rustc 1.63.0 (4b91a6ea7 2022-08-08), dart 2.18 and windows 10.0.19043. The issue persisted in each of the versions described.
cargo build returns this error:
Whats weird is this same function compiled fine earlier, the only changes between working and not was some field name refactors in an unrelated file.
Codegen logs with
RUST_LOG=debug
environment variableTo Reproduce
src/items.rs
Cargo.toml
Expected behavior
I expect the code to compile.
Generated binding code
OS
Windows 10.0.19043
Version of
flutter_rust_bridge_codegen
v1.41.3 and v1.43.0
Flutter info
Version of
clang++
14.0.6
Version of
ffigen
6.0.1
Additional context
No response