-
Notifications
You must be signed in to change notification settings - Fork 307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Vec<Box<XXX>> is not supported in enum. #1072
Comments
Hi! Thanks for opening your first issue here! 😄 |
Hmm looks like a bug. Feel free to PR to fix it! guess about the reason: Maybe we forget to run code generator on the type |
@fzyzcjy Can you solve this issue?allo-isolate |
IMHO the bug is unrelated to allo-isolate |
It seems that |
IIRC, many
Feel free to PR to fix it! If you get stuck, just ping me :) |
Btw does And, is it possible to workaround it by using |
It works well |
impl support::IntoDart for Test {
fn into_dart(self) -> support::DartAbi {
match self {
Self::Nothing => vec![0.into_dart()],
Self::Array(field0) => vec![1.into_dart(), field0.into_dart()],
}
.into_dart()
}
}
impl support::IntoDartExceptPrimitive for Test {} |
The implementation of vec is in https://github.com/sunshine-protocol/allo-isolate/blob/0d361ad97b10e7e2c355c495693bb9a82ad0f95c/src/into_dart.rs#L25-L32 https://github.com/sunshine-protocol/allo-isolate/blob/0d361ad97b10e7e2c355c495693bb9a82ad0f95c/src/dart_array.rs#L17-L34 These codes do not seem to support vec @fzyzcjy |
I see, good observation! Then maybe it should be implemented there. For example, I guess adding a few lines such as impl<T> IntoDart for Box<T>
where
T: IntoDartExceptPrimitive + Sized,
{
fn into_dart(self) -> DartCObject {
(*self).into_dart()
}
} should work |
@fzyzcjy Sorry, I didn't use |
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
Dart code is generated well, but rust code is not generated correctly.
Codegen logs with
RUST_LOG=debug
environment variableTo Reproduce
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
Version of
ffigen
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: