Skip to content

Commit

Permalink
Fix ruby proto3 extension support (#6369)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrei Shevtsov authored and TeBoring committed Jul 28, 2019
1 parent a9bb656 commit 1024cbe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/google/protobuf/compiler/ruby/ruby_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,8 @@ bool GenerateFile(const FileDescriptor* file, io::Printer* printer,
}

// TODO: Remove this when ruby supports extensions for proto2 syntax.
if (file->extension_count() > 0) {
if (file->syntax() == FileDescriptor::SYNTAX_PROTO2 &&
file->extension_count() > 0) {
*error = "Extensions are not yet supported for proto2 .proto files.";
return false;
}
Expand Down

0 comments on commit 1024cbe

Please sign in to comment.