Fix generator error when long_names:false is combined with Oneofs.

Update issue 147
Status: FixedInGit
This commit is contained in:
Petteri Aimonen
2015-02-26 17:33:36 +02:00
parent 651e97456b
commit 4a6580726e
2 changed files with 12 additions and 0 deletions

View File

@@ -587,6 +587,9 @@ class OneOf(Field):
self.name = oneof_desc.name
self.ctype = 'union'
self.fields = []
self.allocation = 'ONEOF'
self.default = None
self.rules = 'ONEOF'
def add_field(self, field):
if field.allocation == 'CALLBACK':

View File

@@ -75,3 +75,12 @@ message SkippedMessage
option (nanopb_msgopt).skip_message = true;
required int32 foo = 1;
}
// Message with oneof field
message OneofMessage
{
oneof foo {
int32 bar = 1;
}
}