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
Under some conditions, bond::DynamicParser may not emit OmittedField for a compile-time schema. For the most transforms that is implemented as a no-op. However, bond::Merge relies on that in order to take data from a struct.
/* struct ABC { 0: int8 a; 1: int8 b; 2: int8 c; }; struct B view_of ABC { b; };*/
bond::CompactBinaryReader<bond::InputBuffer> abc_payload{ {} };
{
ABC abc;
abc.a = 'a';
// Leave ABC::b with default value, such that it will be skipped in the payload.
abc.c = 'c';
bond::OutputBuffer output;
bond::CompactBinaryWriter<bond::OutputBuffer> writer{ output };
bond::Serialize(abc, writer);
abc_payload = { output.GetBuffer() };
}
bond::CompactBinaryReader<bond::InputBuffer> abc_merged_b_payload{ {} };
{
B b;
b.b = 'b';
bond::OutputBuffer output;
bond::CompactBinaryWriter<bond::OutputBuffer> writer{ output };
bond::Merge(b, abc_payload, writer);
abc_merged_b_payload = { output.GetBuffer() };
}
ABC abc;
bond::Deserialize(abc_merged_b_payload, abc);
assert(abc.a == 'a');
assert(abc.b == 'b'); // Fails, since OmittedField is not called for B::bassert(abc.c == 'c');
B b;
bond::Deserialize(abc_merged_b_payload, b);
assert(b.b == 'b'); // Fails, since OmittedField is not called for B::b
The text was updated successfully, but these errors were encountered:
Under some conditions,
bond::DynamicParser
may not emitOmittedField
for a compile-time schema. For the most transforms that is implemented as a no-op. However,bond::Merge
relies on that in order to take data from a struct.The text was updated successfully, but these errors were encountered: