aboutsummaryrefslogtreecommitdiff
path: root/tests/qapi-schema/qapi-schema-test.out
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2019-09-13 22:13:42 +0200
committerMarkus Armbruster <armbru@redhat.com>2019-09-24 14:07:22 +0200
commitf03255362ae3bfd6f105c0fc855c713944f99717 (patch)
tree82cf6ddf03b23e7556833f4c52500730d35aa737 /tests/qapi-schema/qapi-schema-test.out
parent675b214bc6ba2c1d8ac499e339a8cb99c7f23c7c (diff)
qapi: Permit alternates with just one branch
A union or alternate without branches makes no sense and doesn't work: it can't be instantiated. A union or alternate with just one branch works, but is degenerate. We accept the former, but reject the latter. Weird. docs/devel/qapi-code-gen.txt doesn't mention the difference. It claims an alternate definition is "is similar to a simple union type". Permit degenerate alternates to make them consistent with unions. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20190913201349.24332-10-armbru@redhat.com>
Diffstat (limited to 'tests/qapi-schema/qapi-schema-test.out')
-rw-r--r--tests/qapi-schema/qapi-schema-test.out6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/qapi-schema/qapi-schema-test.out b/tests/qapi-schema/qapi-schema-test.out
index fb00a21996..bea7976bbb 100644
--- a/tests/qapi-schema/qapi-schema-test.out
+++ b/tests/qapi-schema/qapi-schema-test.out
@@ -274,6 +274,9 @@ object __org.qemu_x-Union1
member type: __org.qemu_x-Union1Kind optional=False
tag type
case __org.qemu_x-branch: q_obj_str-wrapper
+alternate __org.qemu_x-Alt1
+ tag type
+ case __org.qemu_x-branch: str
array __org.qemu_x-Union1List __org.qemu_x-Union1
object __org.qemu_x-Struct2
member array: __org.qemu_x-Union1List optional=False
@@ -283,8 +286,7 @@ object __org.qemu_x-Union2
case __org.qemu_x-value: __org.qemu_x-Struct2
alternate __org.qemu_x-Alt
tag type
- case __org.qemu_x-branch: str
- case b: __org.qemu_x-Base
+ case __org.qemu_x-branch: __org.qemu_x-Base
event __ORG.QEMU_X-EVENT __org.qemu_x-Struct
boxed=False
array __org.qemu_x-EnumList __org.qemu_x-Enum