@@ -528,6 +528,12 @@ module Enumerable[unchecked out Elem] : _Each[Elem]
528528 #
529529 def entries : () -> ::Array[Elem]
530530
531+ def enum_for : (Symbol method, *untyped , **untyped ) ?{ (?) -> Integer } -> Enumerator[untyped , untyped ]
532+ | () ?{ () -> Integer } -> Enumerator[Elem, self ]
533+
534+ %a{annotate:rdoc:skip}
535+ alias to_enum enum_for
536+
531537 # <!--
532538 # rdoc-file=enum.c
533539 # - select {|element| ... } -> array
@@ -1293,7 +1299,7 @@ module Enumerable[unchecked out Elem] : _Each[Elem]
12931299 # With no block given, returns an Enumerator.
12941300 #
12951301 def reverse_each : () { (Elem arg0) -> untyped } -> void
1296- | () -> ::Enumerator[Elem, void ]
1302+ | () -> ::Enumerator[Elem]
12971303
12981304 # <!--
12991305 # rdoc-file=enum.c
@@ -1754,7 +1760,7 @@ module Enumerable[unchecked out Elem] : _Each[Elem]
17541760 # # show pythagorean triples less than 100
17551761 # p pythagorean_triples.take_while { |*, z| z < 100 }.force
17561762 #
1757- def lazy : () -> Enumerator::Lazy[Elem, void ]
1763+ def lazy : () -> Enumerator::Lazy[Elem]
17581764
17591765 # <!--
17601766 # rdoc-file=enum.c
@@ -1840,7 +1846,7 @@ module Enumerable[unchecked out Elem] : _Each[Elem]
18401846 # e = (1..3).chain([4, 5])
18411847 # e.to_a #=> [1, 2, 3, 4, 5]
18421848 #
1843- def chain : (* self enumerables) -> ::Enumerator::Chain[Elem]
1849+ def chain : [Elem2] (*_Each[Elem2] enumerables) -> ::Enumerator::Chain[Elem | Elem2 ]
18441850
18451851 # <!--
18461852 # rdoc-file=enum.c
@@ -2086,8 +2092,8 @@ module Enumerable[unchecked out Elem] : _Each[Elem]
20862092 # pp lines
20872093 # }
20882094 #
2089- def chunk : [U] () { (Elem elt) -> U } -> ::Enumerator[[ U, ::Array[Elem] ], void ]
2090- | () -> ::Enumerator[Elem, ::Enumerator[[ untyped , ::Array[Elem] ], void ]]
2095+ def chunk : [U] () { (Elem elt) -> U } -> ::Enumerator[[ U, ::Array[Elem] ]]
2096+ | () -> ::Enumerator[Elem, ::Enumerator[[ untyped , ::Array[Elem] ]]]
20912097
20922098 # <!--
20932099 # rdoc-file=enum.c
@@ -2136,7 +2142,7 @@ module Enumerable[unchecked out Elem] : _Each[Elem]
21362142 # Enumerable#slice_when does the same, except splitting when the block returns
21372143 # `true` instead of `false`.
21382144 #
2139- def chunk_while : () { (Elem elt_before, Elem elt_after) -> boolish } -> ::Enumerator[::Array[Elem], void ]
2145+ def chunk_while : () { (Elem elt_before, Elem elt_after) -> boolish } -> ::Enumerator[::Array[Elem]]
21402146
21412147 # <!--
21422148 # rdoc-file=enum.c
@@ -2198,7 +2204,7 @@ module Enumerable[unchecked out Elem] : _Each[Elem]
21982204 # Enumerable#chunk_while does the same, except splitting when the block returns
21992205 # `false` instead of `true`.
22002206 #
2201- def slice_when : () { (Elem elt_before, Elem elt_after) -> boolish } -> ::Enumerator[::Array[Elem], void ]
2207+ def slice_when : () { (Elem elt_before, Elem elt_after) -> boolish } -> ::Enumerator[::Array[Elem]]
22022208
22032209 # <!--
22042210 # rdoc-file=enum.c
@@ -2233,8 +2239,8 @@ module Enumerable[unchecked out Elem] : _Each[Elem]
22332239 # p e.map {|ll| ll[0...-1].map {|l| l.sub(/\\\n\z/, "") }.join + ll.last }
22342240 # #=>["foo\n", "barbaz\n", "\n", "qux\n"]
22352241 #
2236- def slice_after : (untyped pattern) -> ::Enumerator[::Array[Elem], void ]
2237- | () { (Elem elt) -> boolish } -> ::Enumerator[::Array[Elem], void ]
2242+ def slice_after : (untyped pattern) -> ::Enumerator[::Array[Elem]]
2243+ | () { (Elem elt) -> boolish } -> ::Enumerator[::Array[Elem]]
22382244
22392245 # <!--
22402246 # rdoc-file=enum.c
@@ -2390,6 +2396,6 @@ module Enumerable[unchecked out Elem] : _Each[Elem]
23902396 # }
23912397 # }
23922398 #
2393- def slice_before : (untyped pattern) -> ::Enumerator[::Array[Elem], void ]
2394- | () { (Elem elt) -> boolish } -> ::Enumerator[::Array[Elem], void ]
2399+ def slice_before : (untyped pattern) -> ::Enumerator[::Array[Elem]]
2400+ | () { (Elem elt) -> boolish } -> ::Enumerator[::Array[Elem]]
23952401end
0 commit comments