-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix compilation of fields with name identical to their type (#294)
* Revert "Fix compilation of fields named 'bytes' or 'str' (#226)" This reverts commit deb623e. * Fix compilation of fileds with name identical to their type * Added test for field-name identical to python type Co-authored-by: Guy Szweigman <guysz@nvidia.com>
- Loading branch information
Showing
4 changed files
with
38 additions
and
13 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
7 changes: 7 additions & 0 deletions
7
tests/inputs/field_name_identical_to_type/field_name_identical_to_type.json
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,7 @@ | ||
{ | ||
"int": 26, | ||
"float": 26.0, | ||
"str": "value-for-str", | ||
"bytes": "001a", | ||
"bool": true | ||
} |
11 changes: 11 additions & 0 deletions
11
tests/inputs/field_name_identical_to_type/field_name_identical_to_type.proto
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,11 @@ | ||
syntax = "proto3"; | ||
|
||
// Tests that messages may contain fields with names that are identical to their python types (PR #294) | ||
|
||
message Test { | ||
int32 int = 1; | ||
float float = 2; | ||
string str = 3; | ||
bytes bytes = 4; | ||
bool bool = 5; | ||
} |