125125# puts ext_each(o.to_enum) {|*x| puts x; [:b, *x] }
126126# # => [], [:b], [1], [:b, 1], [1, 2], [:b, 1, 2], 3
127127#
128- class Enumerator [unchecked out Elem , out Return = void ] < Object
129- include Enumerable [Elem ]
128+ class Enumerator [unchecked out E , out R = void ] < Object
129+ include Enumerable [E ]
130130
131131 # A convenience interface for `each` with optional block
132132 #
@@ -210,7 +210,7 @@ class Enumerator[unchecked out Elem, out Return = void] < Object
210210 # When a block is given, calls the block with each N-element array generated and
211211 # returns `nil`.
212212 #
213- def self.product : [Elem ] (*_EachEntry[Elem ]) -> Product[Elem ]
213+ def self.product : [E ] (*_EachEntry[E ]) -> Product[E ]
214214
215215 # <!--
216216 # rdoc-file=enumerator.c
@@ -247,7 +247,7 @@ class Enumerator[unchecked out Elem, out Return = void] < Object
247247 # enum.each(:y, :z).equal?(enum) #=> false
248248 # enum.each(:y, :z) { |elm| elm } #=> :method_returned
249249 #
250- def each : () { (Elem arg0) -> untyped } -> Return
250+ def each : () { (E arg0) -> untyped } -> R
251251 | () -> self
252252
253253 # <!--
@@ -295,7 +295,7 @@ class Enumerator[unchecked out Elem, out Return = void] < Object
295295 # e.next # (7)
296296 # # (10)
297297 #
298- def feed : (Elem arg0) -> NilClass
298+ def feed : (E arg0) -> NilClass
299299
300300 # <!--
301301 # rdoc-file=enumerator.c
@@ -321,7 +321,7 @@ class Enumerator[unchecked out Elem, out Return = void] < Object
321321 # lazy fashion (see Enumerator#size). It can either be a value or a callable
322322 # object.
323323 #
324- def initialize : (?Integer arg0) { (Enumerator::Yielder arg0) -> Return } -> void
324+ def initialize : (?Integer arg0) { (Enumerator::Yielder arg0) -> R } -> void
325325
326326 # <!--
327327 # rdoc-file=enumerator.c
@@ -349,7 +349,7 @@ class Enumerator[unchecked out Elem, out Return = void] < Object
349349 #
350350 # See class-level notes about external iterators.
351351 #
352- def next : () -> Elem
352+ def next : () -> E
353353
354354 # <!--
355355 # rdoc-file=enumerator.c
@@ -393,7 +393,7 @@ class Enumerator[unchecked out Elem, out Return = void] < Object
393393 # # yield nil [nil] nil
394394 # # yield [1, 2] [[1, 2]] [1, 2]
395395 #
396- def next_values : () -> ::Array[Elem ]
396+ def next_values : () -> ::Array[E ]
397397
398398 # <!--
399399 # rdoc-file=enumerator.c
@@ -417,7 +417,7 @@ class Enumerator[unchecked out Elem, out Return = void] < Object
417417 # p e.next #=> 3
418418 # p e.peek #raises StopIteration
419419 #
420- def peek : () -> Elem
420+ def peek : () -> E
421421
422422 # <!--
423423 # rdoc-file=enumerator.c
@@ -447,7 +447,7 @@ class Enumerator[unchecked out Elem, out Return = void] < Object
447447 # e.next
448448 # p e.peek_values # raises StopIteration
449449 #
450- def peek_values : () -> ::Array[Elem ]
450+ def peek_values : () -> ::Array[E ]
451451
452452 # <!--
453453 # rdoc-file=enumerator.c
@@ -500,7 +500,7 @@ class Enumerator[unchecked out Elem, out Return = void] < Object
500500 # e = (1..3).each + [4, 5]
501501 # e.to_a #=> [1, 2, 3, 4, 5]
502502 #
503- def + : [Elem2] (::_Each[Elem2]) -> ::Enumerator::Chain[Elem | Elem2]
503+ def + : [Elem2] (::_Each[Elem2]) -> ::Enumerator::Chain[E | Elem2]
504504
505505 # <!--
506506 # rdoc-file=enumerator.c
@@ -514,8 +514,8 @@ class Enumerator[unchecked out Elem, out Return = void] < Object
514514 # `offset`
515515 # : the starting index to use
516516 #
517- def with_index : (?Integer offset) { (Elem arg0, Integer arg1) -> untyped } -> Return
518- | (?Integer offset) -> ::Enumerator[[ Elem , Integer ], Return ]
517+ def with_index : (?Integer offset) { (E arg0, Integer arg1) -> untyped } -> R
518+ | (?Integer offset) -> ::Enumerator[[ E , Integer ], R ]
519519
520520 # <!-- rdoc-file=enumerator.c -->
521521 # Iterates the given block for each element with an arbitrary object, `obj`, and
@@ -540,17 +540,17 @@ class Enumerator[unchecked out Elem, out Return = void] < Object
540540 # # => foo: 1
541541 # # => foo: 2
542542 #
543- def with_object : [U] (U obj) { (Elem , U obj) -> untyped } -> U
544- | [U] (U obj) -> ::Enumerator[[ Elem , U ], U]
543+ def with_object : [U] (U obj) { (E , U obj) -> untyped } -> U
544+ | [U] (U obj) -> ::Enumerator[[ E , U ], U]
545545end
546546
547547# <!-- rdoc-file=enumerator.c -->
548548# Generator
549549#
550- class Enumerator::Generator [out Elem ] < Object
551- include Enumerable [Elem ]
550+ class Enumerator::Generator [out E ] < Object
551+ include Enumerable [E ]
552552
553- def each : () { (Elem ) -> void } -> void
553+ def each : () { (E ) -> void } -> void
554554end
555555
556556# <!-- rdoc-file=enumerator.c -->
619619# # This returns an array of items like a normal enumerator does.
620620# all_checked = active_items.select(&:checked)
621621#
622- class Enumerator::Lazy [out Elem , out Return = void ] < Enumerator[Elem, Return ]
622+ class Enumerator::Lazy [out E , out R = void ] < Enumerator[E, R ]
623623 # <!-- rdoc-file=enumerator.c -->
624624 # Expands `lazy` enumerator to an array. See Enumerable#to_a.
625625 #
@@ -631,15 +631,15 @@ class Enumerator::Lazy[out Elem, out Return = void] < Enumerator[Elem, Return]
631631 # -->
632632 # Like Enumerable#compact, but chains operation to be lazy-evaluated.
633633 #
634- def compact : () -> Enumerator::Lazy[Elem, Return ]
634+ def compact : () -> Enumerator::Lazy[E, R ]
635635
636636 # <!--
637637 # rdoc-file=enumerator.c
638638 # - lzy.eager -> enum
639639 # -->
640640 # Returns a non-lazy Enumerator converted from the lazy enumerator.
641641 #
642- def eager : () -> ::Enumerator[Elem, Return ]
642+ def eager : () -> ::Enumerator[E, R ]
643643end
644644
645645# <!-- rdoc-file=enumerator.c -->
674674#
675675# This type of objects can be created by Enumerable#chain and Enumerator#+.
676676#
677- class Enumerator::Chain [out Elem ] < Enumerator[Elem , void ]
677+ class Enumerator::Chain [out E ] < Enumerator[E , void ]
678678 # <!--
679679 # rdoc-file=enumerator.c
680680 # - Enumerator::Chain.new(*enums) -> enum
@@ -686,7 +686,7 @@ class Enumerator::Chain[out Elem] < Enumerator[Elem, void]
686686 # e.to_a #=> [1, 2, 3, 4, 5]
687687 # e.size #=> 5
688688 #
689- def initialize : (*_Each[Elem ] enums) -> void
689+ def initialize : (*_Each[E ] enums) -> void
690690
691691 # <!--
692692 # rdoc-file=enumerator.c
@@ -699,6 +699,6 @@ class Enumerator::Chain[out Elem] < Enumerator[Elem, void]
699699 #
700700 # If no block is given, returns an enumerator.
701701 #
702- def each : () { (Elem ) -> void } -> self
703- | () -> Enumerator[Elem , self ]
702+ def each : () { (E ) -> void } -> self
703+ | () -> Enumerator[E , self ]
704704end
0 commit comments