Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions core/enumerable.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ module Enumerable[unchecked out Elem] : _Each[Elem]
# {foo: 0, bar: 1, baz: 2}.include?('foo') # => false
# {foo: 0, bar: 1, baz: 2}.include?(0) # => false
#
def include?: (Elem arg0) -> bool
def include?: (untyped object) -> bool

# <!--
# rdoc-file=enum.c
Expand Down Expand Up @@ -1571,7 +1571,7 @@ module Enumerable[unchecked out Elem] : _Each[Elem]
# {foo: 0, bar: 1, baz: 2}.include?('foo') # => false
# {foo: 0, bar: 1, baz: 2}.include?(0) # => false
#
def member?: (Elem arg0) -> bool
alias member? include?

# <!-- rdoc-file=enum.c -->
# Returns the result of applying a reducer to an initial value and the first
Expand Down
11 changes: 11 additions & 0 deletions test/stdlib/Enumerable_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -265,4 +265,15 @@ def test_one_p
assert_send_type '(Class) -> bool', TestEnumerable.new, :one?, String
assert_send_type '() { (String) -> bool } -> bool', TestEnumerable.new, :one? do |x| x == '0' end
end

def test_include?(method: :include?)
with_untyped.and '1' do |element|
assert_send_type '(untyped) -> bool',
TestEnumerable.new, method, element
end
end

def test_member?
test_include?(method: :member?)
end
end