[Ruby] RepeatedField#each raises without a block instead of returning an Enumerator

Open
#29,521 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

  • #30132 by @DeepikaMamidipelly009 — closed without merging

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
cpp, ruby
Domain
api, backend

Research direction

Start by comparing the native and FFI implementations of Google::Protobuf::RepeatedField#each on current main with candidate 69cf8afde5a36d46c31aac7270cf8886b714ab25. Verify blockless calls return an Enumerator while block calls preserve existing behavior, then run the native and source-built FFI enumeration tests described in the issue and confirm there are no failures or errors.

Written by the indexing model from the issue text.

Description

Summary

Both native and FFI Google::Protobuf::RepeatedField#each require a block and raise LocalJumpError when called blocklessly, despite RepeatedField including Enumerable and presenting an Array-like API.

Proposed correction

Wrap the implementation-specific each so a missing block returns enum_for(:each) and block calls continue to use the native/FFI implementation. Candidate: 69cf8afde5a36d46c31aac7270cf8886b714ab25 on current main (5b1c20741838b8359193b97895cb0ff35b4ecf79).

The isolated model covers native and source-built FFI enumeration. The cumulative candidate passes 332 native tests /556,948 assertions and 329 FFI tests /598,403 assertions with no failures or errors (documented omissions only).

I used an AI coding assistant during source review and verification. I am opening an issue first because CONTRIBUTING asks for tests and maintainer agreement; this dependency audit is not permitted to modify repository tests and no CLA was signed as part of it.

Dominant language
C++
Stars
72.2k
Forks
16.4k
Avg merge
1d 8h
Merged PRs (30d)
342

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from protocolbuffers/protobuf

All issues in protocolbuffers/protobuf

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.