-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Closed
Description
While writing up a fix to #8311, I found an odd quirk of the language that I'd like to just bring up for discussion/clarification:
enum NonZero: ubyte {
A = 1
}
table Data {
one: NonZero = A; // totally fine, expected behavior
two: NonZero; // flatc fails to generate with "error: default value of `0` for field `non_zero_default_enum` is not part of enum `NonZeroDefaultEnum`"
three: [NonZero]; // totally fine, expected behavior
}
struct NonZeroStruct {
arr: [NonZero:4]; // compiles???
}
This is currently shipping behavior, and receiving buffers with 0 as a value is not an issue, but I don't think we have a consistent or documented strategy for how to handle this case, especially across languages and generated object APIs.
Metadata
Metadata
Assignees
Labels
No labels