Skip to content

Commit 4b7d5d3

Browse files
#53 Crash when field has the same name as a system type
1 parent 142e976 commit 4b7d5d3

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"int": "value-for-int",
3+
"float": "value-for-float",
4+
"complex": "value-for-complex",
5+
"list": "value-for-list",
6+
"tuple": "value-for-tuple",
7+
"range": "value-for-range",
8+
"str": "value-for-str",
9+
"bytearray": "value-for-bytearray",
10+
"bytes": "value-for-bytes",
11+
"memoryview": "value-for-memoryview",
12+
"set": "value-for-set",
13+
"frozenset": "value-for-frozenset",
14+
"map": "value-for-map",
15+
"bool": "value-for-bool"
16+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
syntax = "proto3";
2+
3+
// Tests that messages may contain fields with names that are python types
4+
5+
message Test {
6+
// https://docs.python.org/2/library/stdtypes.html#numeric-types-int-float-long-complex
7+
string int = 1;
8+
string float = 2;
9+
string complex = 3;
10+
11+
// https://docs.python.org/3/library/stdtypes.html#generator-types
12+
string list = 10;
13+
string tuple = 11;
14+
string range = 12;
15+
16+
// https://docs.python.org/3/library/stdtypes.html#str
17+
string str = 21;
18+
19+
// https://docs.python.org/3/library/stdtypes.html#bytearray-objects
20+
string bytearray = 22;
21+
22+
// https://docs.python.org/3/library/stdtypes.html#bytes-and-bytearray-operations
23+
string bytes = 23;
24+
25+
// https://docs.python.org/3/library/stdtypes.html#memory-views
26+
string memoryview = 24;
27+
28+
// https://docs.python.org/3/library/stdtypes.html#set-types-set-frozenset
29+
string set = 25;
30+
string frozenset = 26;
31+
32+
// https://docs.python.org/3/library/stdtypes.html#dict
33+
string map = 27;
34+
35+
// https://docs.python.org/3/library/stdtypes.html#boolean-values
36+
string bool = 28;
37+
}

0 commit comments

Comments
 (0)