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>
This commit is contained in:
Markus Armbruster 2019-09-27 15:46:20 +02:00
parent 2ab218aad6
commit 481a6bd15c
10 changed files with 32 additions and 22 deletions

View file

@ -1,2 +1,2 @@
tests/qapi-schema/features-duplicate-name.json: In struct 'FeatureStruct0':
tests/qapi-schema/features-duplicate-name.json:1: 'foo' (feature of FeatureStruct0) collides with 'foo' (feature of FeatureStruct0)
tests/qapi-schema/features-duplicate-name.json:1: feature 'foo' collides with feature 'foo'