Skip to content
  • Markus Armbruster's avatar
    f0325536
    qapi: Permit alternates with just one branch · f0325536
    Markus Armbruster authored
    
    
    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: default avatarMarkus Armbruster <armbru@redhat.com>
    Reviewed-by: default avatarEric Blake <eblake@redhat.com>
    Message-Id: <20190913201349.24332-10-armbru@redhat.com>
    f0325536
    qapi: Permit alternates with just one branch
    Markus Armbruster authored
    
    
    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: default avatarMarkus Armbruster <armbru@redhat.com>
    Reviewed-by: default avatarEric Blake <eblake@redhat.com>
    Message-Id: <20190913201349.24332-10-armbru@redhat.com>
Loading