From 99107e64a57921643cc9470b49106316522f810f Mon Sep 17 00:00:00 2001 From: David Renshaw Date: Mon, 19 Sep 2016 15:52:30 -0400 Subject: [PATCH] cover some more cases --- compiler/src/main/cpp/capnpc-java.c++ | 6 +++++- compiler/src/test/schema/test.capnp | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) 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 {}