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