Skip to content

Commit

Permalink
Merge pull request #2036 from tk0miya/stdlib/Kernel.proc
Browse files Browse the repository at this point in the history
stdlib: Make the block arguments of Kernel#proc untyped
  • Loading branch information
soutaro authored Oct 4, 2024
2 parents 2c38541 + 14e92e1 commit 8f8b6db
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/kernel.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -1209,7 +1209,7 @@ module Kernel : BasicObject
# -->
# Equivalent to Proc.new.
#
def self?.proc: () { () -> untyped } -> Proc
def self?.proc: () { (?) -> untyped } -> Proc

# <!--
# rdoc-file=proc.c
Expand Down
5 changes: 5 additions & 0 deletions test/stdlib/Kernel_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ def test_autoload?
end
end

def test_proc
assert_send_type "() { () -> untyped } -> Proc", Kernel, :proc do end
assert_send_type "() { () -> untyped } -> Proc", Kernel, :proc do |a, b| end
end

def test_rand
assert_send_type "() -> Float", Kernel, :rand
assert_send_type "(0) -> Float", Kernel, :rand, 0
Expand Down

0 comments on commit 8f8b6db

Please sign in to comment.