-
Notifications
You must be signed in to change notification settings - Fork 286
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
Generation failing when non-enum default value and dart_enums_style: true
#1767
Comments
On that note, having default values in function parameters yields a Rust compiler error: #[frb]
pub fn test(#[frb(default = "10")] value: usize) {
println!("Hello, world!");
} error: documentation comments cannot be applied to function parameters
--> src\api.rs:3:1
|
3 | #[frb]
| ^^^^^^ doc comments are not allowed here
|
= note: this error originates in the attribute macro `frb` (in Nightly builds, run with -Z macro-backtrace for more info) |
dart_enums_style: true
dart_enums_style: true
Looks like a bug, feel free to fix it (e.g. skip when there is no dot)! Alternatively, I will fix it in the next batch (hopefully within a week).
Hmm, the /cc @Desdaemon who is working on PR #1676 in case it is somehow related |
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
When defining a default value that is not an enum, like this:
#[frb(default = "10")]
, and thedart_enums_style
option is set totrue
, the generator crashes with the following error:File with error on line 57:
flutter_rust_bridge/frb_codegen/src/library/codegen/generator/api_dart/spec_generator/class/field.rs
Lines 45 to 61 in cfd8862
The
enable
parameter istrue
whendart_enums_style
istrue
.For me it seems like non-enum values are not supported in any way by the renaming feature.
Steps to reproduce
Logs
output.txt
Expected behavior
No response
Generated binding code
No response
OS
Windows
Version of
flutter_rust_bridge_codegen
2.0.0-dev.24
Flutter info
No response
Version of
clang++
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: