Conversation
|
|
||
| public static final class Factory extends ListFactory<Builder, Reader> { | ||
| Factory() { | ||
| super(ElementSize.VOID); |
There was a problem hiding this comment.
Does this end up giving a wrong value for the expectedElementSize parameter of WireHelpers.readListPointer()? Maybe we need to add a checkElementSize parameter, like in capnproto-c++? https://github.com/capnproto/capnproto/blob/master/c%2B%2B/src/capnp/layout.c%2B%2B#L2237
There was a problem hiding this comment.
That probably explains why my round-trip test for AnyList fails!
There was a problem hiding this comment.
Am I right in thinking that the actual element size has to be written out when initListPointer is called?
In that case, I think I need to allow the user to pass the appropriate factory to the generated accessor when initiialising the list for building.
There was a problem hiding this comment.
Yes, I agree. For a field
foo @1 :AnyListI think we should generate a method like public <B> B initFooAs(ListFactory<B, ?> factory, int size).
(capnproto-c++ does something similar)
Generate AnyStruct and AnyList types.