core/enumerable.rbs in rbs-3.6.0.dev.1 vs core/enumerable.rbs in rbs-3.6.0.pre.1

- old
+ new

@@ -527,11 +527,11 @@ # (0..4).to_a # => [0, 1, 2, 3, 4] # def entries: () -> ::Array[Elem] def enum_for: (Symbol method, *untyped, **untyped) ?{ (?) -> Integer } -> Enumerator[untyped, untyped] - | () ?{ () -> Integer } -> Enumerator[Elem, self] + | () ?{ () -> Integer } -> Enumerator[Elem, self] %a{annotate:rdoc:skip} alias to_enum enum_for # <!-- @@ -1297,11 +1297,11 @@ # a # => [[:baz, 2], [:bar, 1], [:foo, 0]] # # With no block given, returns an Enumerator. # def reverse_each: () { (Elem arg0) -> untyped } -> void - | () -> ::Enumerator[Elem, void] + | () -> ::Enumerator[Elem] # <!-- # rdoc-file=enum.c # - sort -> array # - sort {|a, b| ... } -> array @@ -1758,11 +1758,11 @@ # p pythagorean_triples.take(10).force # take is lazy, so force is needed # p pythagorean_triples.first(10) # first is eager # # show pythagorean triples less than 100 # p pythagorean_triples.take_while { |*, z| z < 100 }.force # - def lazy: () -> Enumerator::Lazy[Elem, void] + def lazy: () -> Enumerator::Lazy[Elem] # <!-- # rdoc-file=enum.c # - uniq -> array # - uniq {|element| ... } -> array @@ -1844,11 +1844,11 @@ # enumerables. # # e = (1..3).chain([4, 5]) # e.to_a #=> [1, 2, 3, 4, 5] # - def chain: (*self enumerables) -> ::Enumerator::Chain[Elem] + def chain: [Elem2] (*_Each[Elem2] enumerables) -> ::Enumerator::Chain[Elem | Elem2] # <!-- # rdoc-file=enum.c # - tally -> new_hash # - tally(hash) -> hash @@ -2090,12 +2090,12 @@ # /\A\s*\z/ !~ line || nil # }.each { |_, lines| # pp lines # } # - def chunk: [U] () { (Elem elt) -> U } -> ::Enumerator[[ U, ::Array[Elem] ], void] - | () -> ::Enumerator[Elem, ::Enumerator[[ untyped, ::Array[Elem] ], void]] + def chunk: [U] () { (Elem elt) -> U } -> ::Enumerator[[ U, ::Array[Elem] ]] + | () -> ::Enumerator[Elem, ::Enumerator[[ untyped, ::Array[Elem] ]]] # <!-- # rdoc-file=enum.c # - enum.chunk_while {|elt_before, elt_after| bool } -> an_enumerator # --> @@ -2140,11 +2140,11 @@ # #=> [[7, 5, 9], [2, 0], [7, 9], [4, 2, 0]] # # Enumerable#slice_when does the same, except splitting when the block returns # `true` instead of `false`. # - def chunk_while: () { (Elem elt_before, Elem elt_after) -> boolish } -> ::Enumerator[::Array[Elem], void] + def chunk_while: () { (Elem elt_before, Elem elt_after) -> boolish } -> ::Enumerator[::Array[Elem]] # <!-- # rdoc-file=enum.c # - enum.slice_when {|elt_before, elt_after| bool } -> an_enumerator # --> @@ -2202,11 +2202,11 @@ # #=> [["foo\n", "bar\n", "\n"], ["baz\n", "qux\n"]] # # Enumerable#chunk_while does the same, except splitting when the block returns # `false` instead of `true`. # - def slice_when: () { (Elem elt_before, Elem elt_after) -> boolish } -> ::Enumerator[::Array[Elem], void] + def slice_when: () { (Elem elt_before, Elem elt_after) -> boolish } -> ::Enumerator[::Array[Elem]] # <!-- # rdoc-file=enum.c # - enum.slice_after(pattern) -> an_enumerator # - enum.slice_after { |elt| bool } -> an_enumerator @@ -2237,12 +2237,12 @@ # p e.to_a # #=> [["foo\n"], ["bar\\\n", "baz\n"], ["\n"], ["qux\n"]] # p e.map {|ll| ll[0...-1].map {|l| l.sub(/\\\n\z/, "") }.join + ll.last } # #=>["foo\n", "barbaz\n", "\n", "qux\n"] # - def slice_after: (untyped pattern) -> ::Enumerator[::Array[Elem], void] - | () { (Elem elt) -> boolish } -> ::Enumerator[::Array[Elem], void] + def slice_after: (untyped pattern) -> ::Enumerator[::Array[Elem]] + | () { (Elem elt) -> boolish } -> ::Enumerator[::Array[Elem]] # <!-- # rdoc-file=enum.c # - slice_before(pattern) -> enumerator # - slice_before {|elt| ... } -> enumerator @@ -2394,8 +2394,8 @@ # mail.pop if mail.last == "\n" # pp mail # } # } # - def slice_before: (untyped pattern) -> ::Enumerator[::Array[Elem], void] - | () { (Elem elt) -> boolish } -> ::Enumerator[::Array[Elem], void] + def slice_before: (untyped pattern) -> ::Enumerator[::Array[Elem]] + | () { (Elem elt) -> boolish } -> ::Enumerator[::Array[Elem]] end