Skip to content

Commit

Permalink
Fix signature for Enumerable#find.
Browse files Browse the repository at this point in the history
  • Loading branch information
marcandre committed Oct 20, 2020
1 parent 0cb8768 commit afe79d8
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions stdlib/builtin/enumerable.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -307,11 +307,17 @@ module Enumerable[unchecked out Elem, out Return]: _Each[Elem, Return]
# ```
def to_h: () -> ::Hash[untyped, untyped]

def each_slice: (Integer n) { (::Array[Elem] arg0) -> untyped } -> NilClass
def each_slice: (Integer n) { (::Array[Elem]) -> untyped } -> NilClass
| (Integer n) -> ::Enumerator[::Array[Elem], Return]

def find: (?Proc ifnone) { (Elem arg0) -> bool } -> Elem?
| (?Proc ifnone) -> ::Enumerator[Elem, Return]
interface _NotFound[T]
def call: () -> T
end

def find: () { (Elem) -> bool } -> Elem?
| () -> ::Enumerator[Elem, Elem?]
| [T] (_NotFound[T] ifnone) { (Elem) -> bool } -> (Elem | T)
| [T] (_NotFound[T] ifnone) -> ::Enumerator[Elem, Elem | T]

def flat_map: [U] () { (Elem arg0) -> U } -> U
| () -> ::Enumerator[Elem, Return]
Expand Down

0 comments on commit afe79d8

Please sign in to comment.