Skip to content

Commit

Permalink
Update Proc to use (?) -> untyped
Browse files Browse the repository at this point in the history
  • Loading branch information
sampersand authored and soutaro committed Jul 25, 2024
1 parent 712667d commit a34b879
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions core/proc.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@
#
class Proc
interface _Callable
def call: (*untyped, **untyped) ?{ (*untyped, **untyped) -> untyped } -> untyped
def call: (?) -> untyped
end

# <!--
Expand All @@ -306,7 +306,7 @@ class Proc
#
# Proc.new #=> ArgumentError
#
def self.new: () { (*untyped, **untyped) -> untyped } -> instance
def self.new: () { (?) -> untyped } -> instance

def clone: () -> instance
def dup: () -> instance
Expand Down Expand Up @@ -555,7 +555,7 @@ class Proc
#
# See also Proc#lambda?.
#
def call: (*untyped, **untyped) ?{ (*untyped, **untyped) -> untyped } -> untyped
def call: (?) -> untyped

# <!-- rdoc-file=proc.c -->
# Invokes the block, setting the block's parameters to the values in *params*
Expand Down
4 changes: 2 additions & 2 deletions test/stdlib/Proc_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class MyProc < Proc
end

def test_new
assert_send_type '() { (*untyped, **untyped) -> untyped } -> ProcSingletonTest::MyProc',
assert_send_type '() { (?) -> untyped } -> ProcSingletonTest::MyProc',
MyProc, :new do end
end
end
Expand Down Expand Up @@ -96,7 +96,7 @@ def test_binding
end

def test_call(method: :call)
assert_send_type '(*untyped, **untyped) ?{ (*untyped, **untyped) -> untyped } -> untyped',
assert_send_type '(?) -> untyped',
proc{1r}, method, 1, 2i, foo: :three do end
end

Expand Down

0 comments on commit a34b879

Please sign in to comment.