qapi: Improve reporting of member name clashes
commit481a6bd15c4fb99429c3337584c66b40384cb09c
authorMarkus Armbruster <armbru@redhat.com>
Fri, 27 Sep 2019 13:46:20 +0000 (27 15:46 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Sat, 28 Sep 2019 15:17:18 +0000 (28 17:17 +0200)
tree8c8a90d63b63ac65eb526cefb3b75e4c115f63b5
parent2ab218aad6e2ddf4e95a7d583492ad7142927ca5
qapi: Improve reporting of member name clashes

We report name clashes like this:

    struct-base-clash.json: In struct 'Sub':
    struct-base-clash.json:5: 'name' (member of Sub) collides with 'name' (member of Base)

The "(member of Sub)" is redundant with "In struct 'Sub'".  Comes from
QAPISchemaMember.describe().  Pass info to it, so it can detect the
redundancy and avoid it.  Result:

    struct-base-clash.json: In struct 'Sub':
    struct-base-clash.json:5: member 'name' collides with member 'name' of type 'Base'

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20190927134639.4284-8-armbru@redhat.com>
scripts/qapi/common.py
tests/qapi-schema/alternate-clash.err
tests/qapi-schema/args-name-clash.err
tests/qapi-schema/enum-clash-member.err
tests/qapi-schema/features-duplicate-name.err
tests/qapi-schema/flat-union-bad-base.err
tests/qapi-schema/flat-union-clash-member.err
tests/qapi-schema/struct-base-clash-deep.err
tests/qapi-schema/struct-base-clash.err
tests/qapi-schema/union-clash-branches.err