mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-03 20:31:23 +00:00
Fixed .proto translation making scalars into required fields.
Change-Id: If414d156b4e9bc7fead5f131823b2c419cdc4e2c Tested: on Linux.
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user