Protobuf: Compiled nested message definitions return wrong variable name

Created on 30 Jun 2018  路  1Comment  路  Source: protocolbuffers/protobuf

Version: master/v3.5.0.
Language: Ruby
OS: macOS
Compiler: gcc

  1. Add a nested message definition
message parent_msg
{
   message child_msg {}
}
  1. Compile with flag --ruby_out

  2. Result

Google::Protobuf::DescriptorPool.generated_pool.build do
    add_message "parent_msg" do
    end

    add_message "parent_msg.child_msg" do
    end
end

Parent_msg = Google::Protobuf::DescriptorPool.generated_pool.lookup("parent_msg").msgclass
parent_msg::Child_msg = Google::Protobuf::DescriptorPool.generated_pool.lookup("parent_msg.child_msg").msgclass
  1. Error
undefined local variable or method `parent_msg' for main:Object

Expected

Parent_msg::Child_msg = Google::Protobuf::DescriptorPool.generated_pool.lookup("parent_msg.child_msg").msgclass

Got

parent_msg::Child_msg = Google::Protobuf::DescriptorPool.generated_pool.lookup("parent_msg.child_msg").msgclass
P2 bug ruby to-be-fixed

Most helpful comment

I'll have a fix for that.

>All comments

I'll have a fix for that.

Was this page helpful?
0 / 5 - 0 ratings