b86b05ed60
Since line info is remembered as QAPISchema.line now, this patch uses it as additional info for every expr in QAPISchema inside qapi.py, then improves error message with it in checking of exprs. For common union the patch will check whether base is a valid complex type if specified. For flat union it will check whether base presents, whether discriminator is found in base, whether the key of every branch is correct when discriminator is an enum type. Signed-off-by: Wenchao Xia <wenchaoqemu@gmail.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
11 lines
237 B
JSON
11 lines
237 B
JSON
{ 'type': 'TestTypeA',
|
|
'data': { 'string': 'str' } }
|
|
|
|
{ 'type': 'TestTypeB',
|
|
'data': { 'integer': 'int' } }
|
|
|
|
{ 'union': 'TestUnion',
|
|
'base': 'TestBaseWrong',
|
|
'data': { 'value1': 'TestTypeA',
|
|
'value2': 'TestTypeB' } }
|