Skip to content

Generated duplicit associated value for enum variant #8584

Open
@DolajoCZ

Description

@DolajoCZ

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions