So according to the spec (https://capnproto.org/language.html#structs) the
following schema should be valid:
struct FieldWithFlags(Type) {
value @0 : Type;
flag1 @1 : Bool = false;
flag2 @2 : Bool = false;
}
struct MyRecord {
field1 @0 : FieldWithFlags(Text);
field2 @1 : FieldWithFlags(Text) = (flag1 = true);
}
However when I use this, using the C++ compiled code, when I do:
auto field2 = myRecord.initField2();
printf("%d, %d\n", field2.getFlag1(), field2.getFlag2());
Will always print 0 0. In other words, it ignored the default of true for
flag1 I set in MyRecord.
I get the same result even if I DON'T default the values of flag1 and flag2
in FieldWithFlags.
I'm using CapnProto 0.5.3.
Is there something I'm missing? Is this a bug? It should be defaulting
the flag1 for field2 to true.
Preston
--
You received this message because you are subscribed to the Google Groups
"Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
Visit this group at https://groups.google.com/group/capnproto.