From 54eed7ee6f8b79b5306842481b680fee15fbd15e Mon Sep 17 00:00:00 2001 From: Kasumi Hanazuki Date: Thu, 1 Oct 2026 16:28:28 +0000 Subject: [PATCH 1/4] IO::Buffer#slice: refine argument and return types The arguments to IO::Buffer#slice are both optional and the method returns a subclass instance. Assisted-by: Codex:gpt-6.1-sol --- core/io/buffer.rbs | 2 +- test/stdlib/io/Buffer_test.rb | 28 ++++++++++++++++++++++++++-- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/core/io/buffer.rbs b/core/io/buffer.rbs index 96326ad7a..259c8255e 100644 --- a/core/io/buffer.rbs +++ b/core/io/buffer.rbs @@ -1040,7 +1040,7 @@ class IO # # # # # 0x00000000 74 6f 73 74 tost # - def slice: (Integer offset, Integer length) -> Buffer + def slice: (?Integer? offset, ?Integer? length) -> self #