Commit d18c6ec2 authored by Kenton Varda's avatar Kenton Varda

Merge pull request #329 from katreniak/bka-unionInGenericStruct

Bka fix union with group in generic struct
parents 60145838 a435d363
......@@ -1117,39 +1117,39 @@ private:
return FieldText {
kj::strTree(
kj::mv(unionDiscrim.readerIsDecl),
" inline ", titleCase, "::Reader get", titleCase, "() const;\n"
" inline typename ", titleCase, "::Reader get", titleCase, "() const;\n"
"\n"),
kj::strTree(
kj::mv(unionDiscrim.builderIsDecl),
" inline ", titleCase, "::Builder get", titleCase, "();\n"
" inline ", titleCase, "::Builder init", titleCase, "();\n"
" inline typename ", titleCase, "::Builder get", titleCase, "();\n"
" inline typename ", titleCase, "::Builder init", titleCase, "();\n"
"\n"),
hasDiscriminantValue(proto) ? kj::strTree() :
kj::strTree(" inline ", titleCase, "::Pipeline get", titleCase, "();\n"),
kj::strTree(" inline typename ", titleCase, "::Pipeline get", titleCase, "();\n"),
kj::strTree(
kj::mv(unionDiscrim.isDefs),
templateContext.allDecls(),
"inline ", scope, titleCase, "::Reader ", scope, "Reader::get", titleCase, "() const {\n",
"inline typename ", scope, titleCase, "::Reader ", scope, "Reader::get", titleCase, "() const {\n",
unionDiscrim.check,
" return ", scope, titleCase, "::Reader(_reader);\n"
"}\n",
templateContext.allDecls(),
"inline ", scope, titleCase, "::Builder ", scope, "Builder::get", titleCase, "() {\n",
"inline typename ", scope, titleCase, "::Builder ", scope, "Builder::get", titleCase, "() {\n",
unionDiscrim.check,
" return ", scope, titleCase, "::Builder(_builder);\n"
"}\n",
hasDiscriminantValue(proto) ? kj::strTree() : kj::strTree(
"#if !CAPNP_LITE\n",
templateContext.allDecls(),
"inline ", scope, titleCase, "::Pipeline ", scope, "Pipeline::get", titleCase, "() {\n",
"inline typename ", scope, titleCase, "::Pipeline ", scope, "Pipeline::get", titleCase, "() {\n",
" return ", scope, titleCase, "::Pipeline(_typeless.noop());\n"
"}\n"
"#endif // !CAPNP_LITE\n"),
templateContext.allDecls(),
"inline ", scope, titleCase, "::Builder ", scope, "Builder::init", titleCase, "() {\n",
"inline typename ", scope, titleCase, "::Builder ", scope, "Builder::init", titleCase, "() {\n",
unionDiscrim.set,
KJ_MAP(slot, slots) {
switch (sectionFor(slot.whichType)) {
......
......@@ -530,6 +530,13 @@ struct TestGenerics(Foo, Bar) {
foo @0 :Foo;
rev @1 :TestGenerics(Bar, Foo);
union {
uv @2:Void;
ug :group {
ugfoo @3:Int32;
}
}
struct Inner {
foo @0 :Foo;
bar @1 :Bar;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment