Skip to content

Commit 26a27d4

Browse files
committed
Fix type definition
1 parent f689f96 commit 26a27d4

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

core/enumerator.rbs

+4-6
Original file line numberDiff line numberDiff line change
@@ -613,10 +613,6 @@ end
613613
# This type of objects can be created by Enumerable#chain and Enumerator#+.
614614
#
615615
class Enumerator::Chain[out Elem] < Enumerator[Elem, void]
616-
# * `Rubocop: `self` type is not allowed in this context
617-
# * {Enumerator::Chain#each} without block doesn't return `self`, unlike {Enumerator#each}.
618-
#include Enumerator::_Each[Enum, self] # Workaround: def each:
619-
620616
# <!--
621617
# rdoc-file=enumerator.c
622618
# - Enumerator::Chain.new(*enums) -> enum
@@ -641,10 +637,12 @@ class Enumerator::Chain[out Elem] < Enumerator[Elem, void]
641637
#
642638
# If no block is given, returns an enumerator.
643639
#
644-
def each: () { (Enum) -> void } -> self
645-
| () -> Enumerator[E, self]
640+
def each: () { (Elem) -> void } -> self
641+
| () -> Enumerator[Elem, self]
646642

647643
# wrong argument type chain (expected enumerator) (TypeError)
648644
def with_index: (?Integer) ?{ (?) -> untyped } -> bot
645+
646+
# wrong argument type chain (expected enumerator) (TypeError)
649647
def each_with_index: () ?{ (?) -> untyped } -> bot
650648
end

0 commit comments

Comments
 (0)