-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
[Dart, master] Enum named "value" causes variable name conflict #8052
Comments
This issue is stale because it has been open 6 months with no activity. Please comment or label |
This is still an issue |
insertjokehere
added a commit
to insertjokehere/flatbuffers
that referenced
this issue
Apr 19, 2024
…mes not reserved by the Flatbuffers IDL Fixes google#8052 The Flatbuffers IDL allows for enums to have values called "value", "values", "minValue" or "maxValue", but if these names are used for values in an enum, the generated Dart code won't compile. This modifies the Dart generator to use "$value", "$values", "$minValue" and "$maxValue" instead, so that valid Flatbuffer schemas can be used wth Dart
insertjokehere
added a commit
to insertjokehere/flatbuffers
that referenced
this issue
Apr 19, 2024
…mes not reserved by the Flatbuffers IDL Fixes google#8052 The Flatbuffers IDL allows for enums to have values called "value", "values", "minValue" or "maxValue", but if these names are used for values in an enum, the generated Dart code won't compile. This modifies the Dart generator to use "$value", "$values", "$minValue" and "$maxValue" instead, so that valid Flatbuffer schemas can be used wth Dart
insertjokehere
added a commit
to insertjokehere/flatbuffers
that referenced
this issue
Apr 19, 2024
…mes not reserved by the Flatbuffers IDL Fixes google#8052 The Flatbuffers IDL allows for enums to have values called "value", "values", "minValue" or "maxValue", but if these names are used for values in an enum, the generated Dart code won't compile. This modifies the Dart generator to use "$value", "$values", "$minValue" and "$maxValue" instead, so that valid Flatbuffer schemas can be used wth Dart
This issue is stale because it has been open 6 months with no activity. Please comment or label |
Bump |
insertjokehere
added a commit
to insertjokehere/flatbuffers
that referenced
this issue
Aug 16, 2024
…rated classes Fixes google#8052 The Dart code generated for enums includes class properties called 'value', 'values', 'minValue' and 'maxValue'. If the Flatbuffer schema includes enums with these values, the generated code will be invalid. This modifies the Dart generator to rename enum properties if they will conflict with these names (as well as the existing rules to avoid conflicts with Dart keywords)
insertjokehere
added a commit
to insertjokehere/flatbuffers
that referenced
this issue
Aug 16, 2024
…rated classes Fixes google#8052 The Dart code generated for enums includes class properties called 'value', 'values', 'minValue' and 'maxValue'. If the Flatbuffer schema includes enums with these values, the generated code will be invalid. This modifies the Dart generator to rename enum properties if they will conflict with these names (as well as the existing rules to avoid conflicts with Dart keywords)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Declaring an enum name as "value" as in the example below results in a redefined name conflict in the generated dart code.
By running
flatc --dart --gen-all --gen-object-api minimal.fbs
generates the attached invalid dart code in the ExampleEnum class;minimal_test_enum_generated.dart.txt
The text was updated successfully, but these errors were encountered: