IIUC, the way the check is written it forbids any unbounded pointer, including generic type parameters, AnyList, and Capability.
I don't care much either way. Makes it easier for me if the restriction stays: less edge cases to test! :) -Ross On Sat, Aug 26, 2017, 9:20 PM Kenton Varda <[email protected]> wrote: > IIRC it's because not all pointer types can legally exist as list > elements, since struct lists are supposed to be flattened. I was worried > that someone might assume that List(AnyPointer) (where each pointer is set > to an instance of MyStruct) would be compatible with List(MyStruct). > > These days we also have AnyStruct, AnyList, and Capability. I think > List(AnyList) and List(Capability) ought to be made legal if they aren't > already (can't remember). Or in some use cases, it makes sense to replace > List(AnyPointer) with AnyList -- thus supporting lists of any type, as long > as all the elements are the same type. > > -Kenton > > On Sat, Aug 26, 2017 at 8:31 PM, Ross Light <[email protected]> wrote: > >> Hopefully a straightforward question: why does `capnp compile` have a >> special case to error out >> <https://github.com/capnproto/capnproto/blob/cc74158d90de65349b191dd93392003179823ae3/c%2B%2B/src/capnp/compiler/node-translator.c%2B%2B#L972> >> on List(AnyPointer) and variants thereof? I don't have a burning need to >> use it in a real schema — I came across this while I was trying to unit >> test edge cases in some new go-capnproto2 code — but it surprised me. I >> dug around in git history and it seems like it's been around since 2013 >> <https://github.com/capnproto/capnproto/commit/34e70d5acdceba9494025f9097feae599053b30a>, >> and I don't see anything that helps me with rationale. I would expect it >> to act as a non-composite pointer list. >> >> Thanks for any pointers! >> -Ross >> > -- >> 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. >> > -- 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.
