ruby / ruby/rbs

`_Range[T]` shouldn't return `T?` for `begin` and `end`

Open
#1,494 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
2.2k
Forks
256
Avg merge
6d 17h
Merged PRs (30d)
37

Description

The interface _Range[T] currently returns T? for begin and end. This precludes ranges which require both a beginning and an end (eg used in Kernel#rand).

The solution is to make begin and end return T, and convert all current uses of _Range[T] to _Range[T?]. (There aren't any uses of _Range[T] currently—definitions that use it are currently in-flight and haven't been merged yet)

Contributor guide

Open the contributing guide

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.

Research direction

No file, test, or entry point is named in the issue. Start by locating the _Range[T] interface and the in-flight definitions that use it; done means begin and end return T, while nullable range behavior is represented through _Range[T?].

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
tooling
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.