Fix compilation of fields with name identical to their type (#294)

* Revert "Fix compilation of fields named 'bytes' or 'str' (#226)"

This reverts commit deb623ed14.

* 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>
This commit is contained in:
guysz
2021-12-01 18:31:02 +02:00
committed by GitHub
parent a4d2d39546
commit b0a36d12e4
4 changed files with 38 additions and 13 deletions

View File

@@ -0,0 +1,7 @@
{
"int": 26,
"float": 26.0,
"str": "value-for-str",
"bytes": "001a",
"bool": true
}

View File

@@ -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;
}