diff --git a/compiler/src/main/cpp/capnpc-java.c++ b/compiler/src/main/cpp/capnpc-java.c++ index 698e000..e158d6c 100644 --- a/compiler/src/main/cpp/capnpc-java.c++ +++ b/compiler/src/main/cpp/capnpc-java.c++ @@ -937,6 +937,7 @@ private: spaces(indent), " throw new Error();\n", spaces(indent), " }\n", spaces(indent), " public final ", type, ".Builder init", titleCase, "() {\n", + unionDiscrim.set, spaces(indent), " return ", type, ".factory.fromStructBuilder(_builder.getPointerField(", offset, ").initStruct(", type, ".STRUCT_SIZE", "));\n",