Skip to content

Refine types for IO::Buffer methods that return subclass instances - #3190

Merged
ksss merged 4 commits into
ruby:masterfrom
hanazuki:IOBuffer-subclass
Oct 3, 2026
Merged

ksss merged 4 commits into
ruby:masterfrom
hanazuki:IOBuffer-subclass

Conversation

@hanazuki

@hanazuki hanazuki commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

This patchset refines the type signatures for the following methods: IO::Buffer#slice, #transfer, .for, and .string.
When IO::Buffer is subclassed, those methods return and/or yield an instance of the subclass.

The arguments to IO::Buffer#slice are both optional and
the method returns a subclass instance.

Assisted-by: Codex:gpt-6.1-sol
IO::Buffer#transfer returns a subclass instance.

Assisted-by: Codex:gpt-6.1-sol
Assisted-by: Codex:gpt-6.1-sol
Assisted-by: Codex:gpt-6.1-sol

@ksss ksss left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incredible!

@ksss
ksss added this pull request to the merge queue Oct 3, 2026
Merged via the queue into ruby:master with commit bce513d Oct 3, 2026
24 checks passed
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

Successfully merging this pull request may close these issues.

2 participants