Skip to content
Merged
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
20 changes: 12 additions & 8 deletions test/stdlib/Class_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,21 @@ def initialize(*a, **k, &b) = nil
end

def test_initialize
assert_send_type "() -> void",
Class.allocate, :initialize
# Class#initialize was removed in Ruby 4.1 and Class.allocate raises TypeError
# https://github.com/ruby/ruby/commit/0adee861cb586a011fc4c77eb00758cb3f2cfd93
if_ruby(..."4.1") do
assert_send_type "() -> void",
Class.allocate, :initialize

assert_send_type "() { (Class) [self: Class] -> void } -> void",
Class.allocate, :initialize do end
assert_send_type "() { (Class) [self: Class] -> void } -> void",
Class.allocate, :initialize do end

assert_send_type "(Class) -> void",
Class.allocate, :initialize, String
assert_send_type "(Class) -> void",
Class.allocate, :initialize, String

assert_send_type "(Class) { (Class) [self: Class] -> void } -> void",
Class.allocate, :initialize, String do end
assert_send_type "(Class) { (Class) [self: Class] -> void } -> void",
Class.allocate, :initialize, String do end
end
end

def test_superclass
Expand Down
Loading