fzyzcjy / flutter_rust_bridge

Flutter/Dart <-> Rust binding generator, feature-rich, but seamless and simple.
https://fzyzcjy.github.io/flutter_rust_bridge/
MIT License
3.64k stars 256 forks source link

Missing imports when spreading Impl blocks in multiple files #1933

Closed kjzl closed 2 weeks ago

kjzl commented 2 weeks ago

Describe the bug

When having a struct and an Impl for the struct in one file, and another impl for the same struct in another file with 'use' statements which werent made in the other file, they will be missing on the dart side's merged class implementation.

Steps to reproduce

-

Logs

-

Expected behavior

No response

Generated binding code

No response

OS

No response

Version of flutter_rust_bridge_codegen

No response

Flutter info

No response

Version of clang++

No response

Additional context

No response

fzyzcjy commented 2 weeks ago

Hi, could you please provide an exact minimal reproducible sample?

kjzl commented 2 weeks ago

https://github.com/kjzl/frb_impl_dart_missing_imports/blob/a136f40071c1df91f0f5d831a7728e2c7d864d6c/rust/src/api/b.rs#L3-L13

fzyzcjy commented 2 weeks ago

Ah I see, then this is a bug. Feel free to PR for it, alternatively I will fix it later! Since this has simple workaround (move the multiple impl block for one single struct in one file), I may not fix it with highest priority.

In addition, I am considering enhancing the parser of use, thus maybe fixing this when doing that is also reasonable.

github-actions[bot] commented 3 minutes ago

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.