Eric Blake <ebl...@redhat.com> writes: > Now that we know every expression is valid with regards to > its keys, we can add further tests that those keys refer to > valid types. With this patch, all uses of a type (the 'data': > of command, type, union, alternate, and event; the 'returns': > of command; the 'base': of type and union) must resolve to an > appropriate subset of metatypes declared by the current qapi > parse; this includes recursing into each member of a data > dictionary. Dealing with '**' and nested anonymous structs > will be done in later patches. > > Update the testsuite to match improved output. > > Signed-off-by: Eric Blake <ebl...@redhat.com> [...] > diff --git a/scripts/qapi.py b/scripts/qapi.py > index 686bc86..9f64a0d 100644 > --- a/scripts/qapi.py > +++ b/scripts/qapi.py [...] > @@ -352,6 +414,11 @@ def check_union(expr, expr_info): > > # Check every branch > for (key, value) in members.items(): > + # Each value must name a known type; futhermore, in flat unions,
furthermore > + # branches must be a struct > + check_type(expr_info, "Member '%s' of union '%s'" % (key, name), > + value, allow_array=True, allow_metas=allow_metas) > + > # If the discriminator names an enum type, then all members > # of 'data' must also be members of the enum type. > if enum_define: [...] Regardless, Reviewed-by: Markus Armbruster <arm...@redhat.com>