From 84de697580891e4692748598761df568d363898b Mon Sep 17 00:00:00 2001 From: ParadoxV5 Date: Fri, 13 Sep 2024 19:37:10 -0600 Subject: [PATCH] Make `R`eturn of `_Each` optional --- core/builtin.rbs | 8 ++++---- core/enumerator.rbs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/builtin.rbs b/core/builtin.rbs index ad1253bc0..564dfd00d 100644 --- a/core/builtin.rbs +++ b/core/builtin.rbs @@ -170,12 +170,12 @@ interface _Inspect def inspect: () -> String end -interface _Each[out A] - def each: () { (A) -> void } -> void +interface _Each[out E, out R = void] + def each: () { (E) -> void } -> R end -interface _EachEntry[out A] - def each_entry: () { (A) -> void } -> self +interface _EachEntry[out E] + def each_entry: () { (E) -> void } -> self end interface _Reader diff --git a/core/enumerator.rbs b/core/enumerator.rbs index 3dc077472..69a5bb5da 100644 --- a/core/enumerator.rbs +++ b/core/enumerator.rbs @@ -132,7 +132,7 @@ class Enumerator[unchecked out Elem, out Return = void] < Object # A convenience interface for `each` with optional block # - interface _Each[out E, out R] + interface _Each[out E, out R = self] def each: () { (E) -> void } -> R | () -> Enumerator[E, R] end