Skip to content

Generated duplicit associated value for enum variant #8584

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

Open
DolajoCZ opened this issue Apr 24, 2025 · 0 comments
Open

Generated duplicit associated value for enum variant #8584

DolajoCZ opened this issue Apr 24, 2025 · 0 comments

Comments

@DolajoCZ
Copy link

For enums where you define values for some variants can flatc generate same value for multiple variants.

Simple example:

enum Color : byte { Red = 4, Green = 3, Blue }

In this case is Red = 4 and flatc generate Blue=4. Then if you serialize Color:Blue and then deserialize back you get Color:Red.

It should generate next available value, not only next value from previous as it is write now. Or at least some error/warning during compilation of fbs schema.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant