Fixed .proto translation making scalars into required fields.

Change-Id: If414d156b4e9bc7fead5f131823b2c419cdc4e2c
Tested: on Linux.
This commit is contained in:
Wouter van Oortmerssen
2015-09-25 09:21:31 -07:00
parent 811a5c3389
commit feb4816610
3 changed files with 5 additions and 5 deletions

View File

@@ -1080,7 +1080,7 @@ void Parser::ParseProtoDecl() {
Expect(kTokenIntegerConstant);
auto &field = AddField(struct_def, name, type);
field.doc_comment = field_comment;
field.required = required;
if (!IsScalar(type.base_type)) field.required = required;
// See if there's a default specified.
if (IsNext('[')) {
if (attribute_ != "default") Error("\'default\' expected");