Skip to content
New issue

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

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

Already on GitHub? # to your account

Potential bug with interface within generic class #440

Closed
wants to merge 2 commits into from
Closed
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
10 changes: 8 additions & 2 deletions stdlib/builtin/enumerable.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,14 @@ module Enumerable[unchecked out Elem, out Return]: _Each[Elem, Return]
def each_slice: (Integer n) { (::Array[Elem] arg0) -> 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 arg0) -> bool } -> Elem?
| () -> ::Enumerator[Elem, Elem?]
| [T] (_NotFound[T] ifnone) { (Elem arg0) -> bool } -> (Elem | T)
| [T] (_NotFound[T] ifnone) -> ::Enumerator[Elem, Elem | T]

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