@ -651,25 +651,25 @@ class QAPISchemaAlternateType(QAPISchemaType):
doc : Optional [ QAPIDoc ] ,
ifcond : Optional [ QAPISchemaIfCond ] ,
features : List [ QAPISchemaFeature ] ,
v aria nts: QAPISchemaAlternatives ,
alte rna tive s : QAPISchemaAlternatives ,
) :
super ( ) . __init__ ( name , info , doc , ifcond , features )
assert v aria nts. tag_member
v aria nts. set_defined_in ( name )
v aria nts. tag_member . set_defined_in ( self . name )
self . v aria nts = v aria nts
assert alte rna tive s . tag_member
alte rna tive s . set_defined_in ( name )
alte rna tive s . tag_member . set_defined_in ( self . name )
self . alte rna tive s = alte rna tive s
def check ( self , schema : QAPISchema ) - > None :
super ( ) . check ( schema )
self . v aria nts. tag_member . check ( schema )
# Not calling self.v aria nts.check_clash(), because there's nothing
# to clash with
self . v aria nts. check ( schema , { } )
self . alte rna tive s . tag_member . check ( schema )
# Not calling self.alte rna tive s.check_clash(), because there's
# nothing to clash with
self . alte rna tive s . check ( schema , { } )
# Alternate branch names have no relation to the tag enum values;
# so we have to check for potential name collisions ourselves.
seen : Dict [ str , QAPISchemaMember ] = { }
types_seen : Dict [ str , str ] = { }
for v in self . v aria nts. variants :
for v in self . alte rna tive s . variants :
v . check_clash ( self . info , seen )
qtype = v . type . alternate_qtype ( )
if not qtype :
@ -700,7 +700,7 @@ class QAPISchemaAlternateType(QAPISchemaType):
def connect_doc ( self , doc : Optional [ QAPIDoc ] = None ) - > None :
super ( ) . connect_doc ( doc )
doc = doc or self . doc
for v in self . v aria nts. variants :
for v in self . alte rna tive s . variants :
v . connect_doc ( doc )
def c_type ( self ) - > str :
@ -712,7 +712,8 @@ class QAPISchemaAlternateType(QAPISchemaType):
def visit ( self , visitor : QAPISchemaVisitor ) - > None :
super ( ) . visit ( visitor )
visitor . visit_alternate_type (
self . name , self . info , self . ifcond , self . features , self . variants )
self . name , self . info , self . ifcond , self . features ,
self . alternatives )
class QAPISchemaVariants :