Commit fa110c6a authored by Markus Armbruster's avatar Markus Armbruster
Browse files

qapi: Move context-sensitive checking to the proper place



When we introduced the QAPISchema intermediate representation (commit
ac88219a), we took a shortcut: we left check_exprs() & friends
alone instead of moving semantic checks into the
QAPISchemaFOO.check().  The .check() assert check_exprs() did its job.

Time to finish the conversion job.  Move exactly the context-sensitive
checks to the .check().  They replace assertions there.  Context-free
checks stay put.

Fixes the misleading optional tag error demonstrated by test
flat-union-optional-discriminator.

A few other error message improve.

Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
Reviewed-by: default avatarEric Blake <eblake@redhat.com>
Message-Id: <20190927134639.4284-17-armbru@redhat.com>
parent 77daece3
Loading
Loading
Loading
Loading
+193 −231

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1
Original line number Diff line number Diff line
tests/qapi-schema/alternate-any.json: In alternate 'Alt':
tests/qapi-schema/alternate-any.json:2: alternate 'Alt' member 'one' cannot use type 'any'
tests/qapi-schema/alternate-any.json:2: branch 'one' cannot use built-in type 'any'
+1 −1
Original line number Diff line number Diff line
tests/qapi-schema/alternate-conflict-bool-string.json: In alternate 'Alt':
tests/qapi-schema/alternate-conflict-bool-string.json:2: alternate 'Alt' member 'two' can't be distinguished from member 'one'
tests/qapi-schema/alternate-conflict-bool-string.json:2: branch 'two' can't be distinguished from 'one'
+1 −1
Original line number Diff line number Diff line
tests/qapi-schema/alternate-conflict-dict.json: In alternate 'Alt':
tests/qapi-schema/alternate-conflict-dict.json:6: alternate 'Alt' member 'two' can't be distinguished from member 'one'
tests/qapi-schema/alternate-conflict-dict.json:6: branch 'two' can't be distinguished from 'one'
+1 −1
Original line number Diff line number Diff line
tests/qapi-schema/alternate-conflict-enum-bool.json: In alternate 'Alt':
tests/qapi-schema/alternate-conflict-enum-bool.json:4: alternate 'Alt' member 'two' can't be distinguished from member 'one'
tests/qapi-schema/alternate-conflict-enum-bool.json:4: branch 'two' can't be distinguished from 'one'
Loading