I cannot figure out how to instantiate an Option(T) type in pycapnp.
I have tried to instantiate a new message and then set the value of 'some', but it loses type information in doing so.
struct Option(T) {
union {
none @0 :Void;
some @1 :T;
}
}
struct Something {
a @0 :Int16;
}
o = Option.new_message()
o.some = Something.new_message(a=5)
o.some.a // throws error
I would expect the option to become typed by virtue of the added struct, but it loses all type information and I cannot access the members of the object placed in the 'some' union value.