forked from bonzini/qemu
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
WIP: detect ambiguous alternates at compile time
This breaks test code. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
- Loading branch information
Showing
23 changed files
with
82 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| tests/qapi-schema/alternate-ambiguous-bool.json:4: Alternate 'EnumOrNumber' member 'e' can't be distinguished from enum 'AmbiguousEnum' member 'yes' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { 'enum': 'AmbiguousEnum', | ||
| 'data': ['maybe', 'yes', 'no'] } | ||
|
|
||
| { 'alternate': 'EnumOrNumber', | ||
| 'data': { 'e': 'AmbiguousEnum', 'b': 'bool' } } |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| tests/qapi-schema/alternate-ambiguous-num.json:4: Alternate 'EnumOrNumber' member 'e' can't be distinguished from enum 'AmbiguousEnum' member '3' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { 'enum': 'AmbiguousEnum', | ||
| 'data': ['one', 'two', '3'] } | ||
|
|
||
| { 'alternate': 'EnumOrNumber', | ||
| 'data': { 'e': 'AmbiguousEnum', 'i': 'int' } } |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| tests/qapi-schema/alternate-ambiguous-str-scalar.json:1: Alternate 'StrOrNumber' scalar member 'n' can't can't be distinguished from string member 's' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| { 'alternate': 'StrOrNumber', | ||
| 'data': { 's': 'str', 'n': 'number' } } |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| tests/qapi-schema/alternate-nested.json:4: Member 'nested' of alternate 'Alt2' cannot use alternate type 'Alt1' | ||
| tests/qapi-schema/alternate-nested.json:6: Member 'nested' of alternate 'Alt2' cannot use alternate type 'Alt1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,7 @@ | ||
| # we reject a nested alternate branch | ||
| { 'enum': 'MyEnum', | ||
| 'data': ['one', 'two', 'three']} | ||
| { 'alternate': 'Alt1', | ||
| 'data': { 'name': 'str', 'value': 'int' } } | ||
| 'data': { 'e': 'MyEnum', 'value': 'int' } } | ||
| { 'alternate': 'Alt2', | ||
| 'data': { 'nested': 'Alt1', 'b': 'bool' } } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| # we do not allow alternate arguments | ||
| { 'alternate': 'Alt', 'data': { 'case1': 'int', 'case2': 'str' } } | ||
| { 'alternate': 'Alt', 'data': { 'case1': 'int', 'case2': 'bool' } } | ||
| { 'command': 'oops', 'data': 'Alt' } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,4 +6,4 @@ | |
| # @bb: b | ||
| ## | ||
| { 'alternate': 'AorB', | ||
| 'data': { 'a': 'str', 'b': 'int' } } | ||
| 'data': { 'a': 'bool', 'b': 'int' } } | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| # we reject returns if it is an alternate type | ||
| { 'alternate': 'Alt', 'data': { 'a': 'int', 'b': 'str' } } | ||
| { 'alternate': 'Alt', 'data': { 'a': 'int', 'b': 'bool' } } | ||
| { 'command': 'oops', 'returns': 'Alt' } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters