Explorar o código

Fix ruby proto3 extension support (#6369)

Andrei Shevtsov %!s(int64=6) %!d(string=hai) anos
pai
achega
1024cbea34
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      src/google/protobuf/compiler/ruby/ruby_generator.cc

+ 2 - 1
src/google/protobuf/compiler/ruby/ruby_generator.cc

@@ -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;
   }