Skip to content

Commit

Permalink
Revert "Merge pull request #1668 from Forthoney/master"
Browse files Browse the repository at this point in the history
This reverts commit 6cb2f3c, reversing
changes made to 20ccb5a.
  • Loading branch information
soutaro committed Dec 20, 2023
1 parent 6d12eb4 commit 2859c47
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 28 deletions.
5 changes: 3 additions & 2 deletions core/thread.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -991,8 +991,9 @@ class Thread < Object
# from prog.rb:2:in `new'
# from prog.rb:2
#
def raise: (?String message) -> nil
| (_Exception, ?_ToS message, ?Array[String] backtrace) -> nil
def self?.raise: () -> bot
| (String message, ?cause: Exception?) -> bot
| (_Exception exception, ?untyped message, ?::Array[String] backtrace, ?cause: Exception?) -> bot

# <!--
# rdoc-file=thread.c
Expand Down
26 changes: 0 additions & 26 deletions test/stdlib/Thread_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,30 +43,4 @@ def test_native_thread_id
Thread.current, :native_thread_id
)
end

def test_raise
t = Thread.new do
begin
sleep
rescue
retry
end
end
t.report_on_exception = false

assert_send_type "() -> nil",
t, :raise
assert_send_type "(String) -> nil",
t, :raise, "Error!"
assert_send_type "(singleton(StandardError)) -> nil",
t, :raise, StandardError
assert_send_type "(StandardError) -> nil",
t, :raise, StandardError.new('Error!')
assert_send_type "(singleton(StandardError), String) -> nil",
t, :raise, StandardError, 'Error!'
assert_send_type "(singleton(StandardError), String, Array[String]) -> nil",
t, :raise, StandardError, 'Error!', caller

t.kill
end
end

0 comments on commit 2859c47

Please sign in to comment.