diff --git a/compiler/src/main/cpp/capnpc-java.c++ b/compiler/src/main/cpp/capnpc-java.c++ index 57d0c31..c9c3595 100644 --- a/compiler/src/main/cpp/capnpc-java.c++ +++ b/compiler/src/main/cpp/capnpc-java.c++ @@ -1191,7 +1191,11 @@ private: bool isGeneric = false; { - auto type = field.getType().asList().getElementType(); + auto type = field.getType(); + while (type.isList()) { + type = type.asList().getElementType(); + } + if (type.isStruct()) { isGeneric = type.asStruct().getProto().getIsGeneric(); } diff --git a/compiler/src/test/schema/test.capnp b/compiler/src/test/schema/test.capnp index 3352781..2f6aa9c 100644 --- a/compiler/src/test/schema/test.capnp +++ b/compiler/src/test/schema/test.capnp @@ -386,6 +386,11 @@ struct GenericMap(K, V) key @0 :K; value @1 :V; } + + # Some other things that might cause problems. + a @1 :List(TestAllTypes); + b @2 :List(List(Entry)); + c @3 :List(List(List(Entry))); } struct TestEmptyStruct {}