Skip to content

Boxed enum serialization#197

Open
mcm2020 wants to merge 5 commits into
ReubenBond:mainfrom
mcm2020:boxedEnumSerialization
Open

Boxed enum serialization#197
mcm2020 wants to merge 5 commits into
ReubenBond:mainfrom
mcm2020:boxedEnumSerialization

Conversation

@mcm2020

@mcm2020 mcm2020 commented Jun 21, 2022

Copy link
Copy Markdown
Contributor

Reproducing the serialization/deserialization issue for boxed enums that have a generated serializer.

writer.WriteFieldHeaderExpected(fieldIdDelta, WireType.VarInt);
// When WriteFieldHeaderExpected() is used, the boxed enum will not deserialized correctly
//writer.WriteFieldHeaderExpected(fieldIdDelta, WireType.VarInt);
writer.WriteFieldHeader(fieldIdDelta, expectedType, CodecFieldType, WireType.VarInt);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not quite right: the 'actual' type should be the enum type, but this would result in 'int'

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

Successfully merging this pull request may close these issues.

2 participants