Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix signature for Enumerable#find. #437

Merged
merged 1 commit into from
Oct 28, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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