You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In light of #30 (comment), I propose to make a few tweaks to enums.
An enum defined in an encoding = 2 file must have an underlying type.
Rationale: we want to reserve the Slice2 encoding of enums (both checked and unchecked) without underlying type for the future enums-with-values.
A checked or unchecked enum defined in an encoding = 1 file cannot have an underlying type (that's already the case today).
Rationale: there is only one Slice1 encoding for enums and it would be confusing the add an optional underlying type with no effect on the Slice1 encoding.
A checked or unchecked enum defined in an encoding = 1 file is mapped and encoded with Slice2 as if if had been defined in an encoding = 2 file with the varint32 underlying type. (Already the case today).
Rationale: language-mapping wise, that's the only reasonable behavior.
This means:
encoding = 1
unchecked enum Error { NotFound }
cannot carry "-1" when encoded with Slice1, but can when encoded with Slice2.
The text was updated successfully, but these errors were encountered:
In light of #30 (comment), I propose to make a few tweaks to enums.
An enum defined in an
encoding = 2
file must have an underlying type.Rationale: we want to reserve the Slice2 encoding of enums (both checked and unchecked) without underlying type for the future enums-with-values.
A checked or unchecked enum defined in an
encoding = 1
file cannot have an underlying type (that's already the case today).Rationale: there is only one Slice1 encoding for enums and it would be confusing the add an optional underlying type with no effect on the Slice1 encoding.
A checked or unchecked enum defined in an
encoding = 1
file is mapped and encoded with Slice2 as if if had been defined in anencoding = 2
file with thevarint32
underlying type. (Already the case today).Rationale: language-mapping wise, that's the only reasonable behavior.
This means:
cannot carry "-1" when encoded with Slice1, but can when encoded with Slice2.
The text was updated successfully, but these errors were encountered: