Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Ruby] 3.15 regression: Cannot get repeated field values using bracket notation #8317

Closed
dazuma opened this issue Feb 19, 2021 · 1 comment
Closed

Comments

@dazuma
Copy link
Contributor

dazuma commented Feb 19, 2021

What version of protobuf and what language are you using?
Version: 3.15.0
Language: Ruby

What operating system (Linux, Windows, ...) and version?
Various (tried on both gLinux x86_64, Mac Catalina x86_64)

What runtime / compiler are you using (e.g., python version or gcc version)
Using the prebuilt release binary for Ruby.

What did you do?

require "google/protobuf"
Google::Protobuf::DescriptorPool.generated_pool.build do
  add_file("blah.proto", syntax: :proto3) do
    add_message "TestProto" do
      optional :single, :string, 1
      repeated :multi, :string, 2
    end
  end
end
TestProto = Google::Protobuf::DescriptorPool.generated_pool.lookup("TestProto").msgclass
message = TestProto.new(single: "hello", multi: ["a", "b"])
p message.single
p message["single"]
p message.multi
p message["multi"]

What did you expect to see
This is what I see under google-protobuf 3.14.0:

"hello"
"hello"
["a", "b"]
["a", "b"]

What did you see instead?
This is what I see under google-protobuf 3.15.0:

"hello"
"hello"
["a", "b"]
""
@haberman
Copy link
Member

Closing as duplicate of #8311

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants