-
Notifications
You must be signed in to change notification settings - Fork 303
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
Add option to ignore "Automatically rename function names to avoid keyword conflict" check #2194
Comments
Looks reasonable! Then we should change the check when it is used as function name. Feel free to PR for this, alternatively I will work on it in the next batch. For completeness: The workaround - as you have already done - is to stick to 2.0.0 before it is fixed |
Thank you for the swift response! Some notes: See footnote on Dart keywords, keywords that are flagged 2-3 should be good to use as a function name. Keywords that are flagged 1 are not safe to use as a function name in some contexts. |
I see.
Then a simpler method may be:
|
sync API on bindings had caused a regression with 2.1.0 changes: fzyzcjy/flutter_rust_bridge#2194 which is now resolved with 2.2.0.
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
Re: Automatically rename function names to avoid keyword conflict #2150
We have method named
sync()
on our project, which didn't cause any keyword conflict issues so far*, and with this new change, it's generated assync_()
.Force renaming it as
sync
via #[frb(name = "...")] macro isn't applied.Can we add a macro to ignore this check or apply the rename macro after this check?
Thanks!
*: After investigating, not all Dart keywords cause an issue when used as a function name so there has to be made a distinction between problematic & unproblematic ones when automatically renaming.
Steps to reproduce
Create an empty Dart project & class, then create functions using Dart keywords. Here are a couple of the cases I run into and there ought to be more.
default()
false()
else()
sync()
Expected behavior
Automatic rename should not apply to Dart keywords that are not problematic to be used as a function name.
Generated binding code
OS
macOS Sonoma Version 14.5
Version of
flutter_rust_bridge_codegen
2.1.0
Flutter info
Version of
clang++
clang version 18.1.5
Additional context
No response
The text was updated successfully, but these errors were encountered: