Fix generator error when long_names:false is combined with Oneofs.
Update issue 147 Status: FixedInGit
This commit is contained in:
@@ -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':
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user