@@ -419,7 +419,9 @@ def check_member_clash(expr_info, base_name, data, source = ""):
assert base
base_members = base['data']
for key in data.keys():
- if key in base_members:
+ if key.startswith('*'):
+ key = key[1:]
+ if key in base_members or "*%s" %key in base_members:
raise QAPIExprError(expr_info,
"Member name '%s'%s clashes with base '%s'"
%(key, source, base_name))
@@ -2,7 +2,7 @@
{ 'enum': 'TestEnum',
'data': [ 'value1', 'value2' ] }
{ 'struct': 'Base',
- 'data': { 'enum1': 'TestEnum', 'name': 'str' } }
+ 'data': { 'enum1': 'TestEnum', '*name': 'str' } }
{ 'struct': 'Branch1',
'data': { 'name': 'str' } }
{ 'struct': 'Branch2',
@@ -6,4 +6,4 @@
'data': { 'value': 'int' } }
{ 'struct': 'Sub',
'base': 'Mid',
- 'data': { 'name': 'str' } }
+ 'data': { '*name': 'str' } }
A conflict must be marked even when the two dictionaries being compared differ on whether the key is marked optional. Signed-off-by: Eric Blake <eblake@redhat.com> --- scripts/qapi.py | 4 +++- tests/qapi-schema/flat-union-branch-clash.json | 2 +- tests/qapi-schema/struct-base-clash-deep.json | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-)