From f56a48ec80a96ff53dc0e9adb0dcfd0a66e9dd70 Mon Sep 17 00:00:00 2001 From: SamW Date: Sun, 26 Nov 2023 13:52:15 -0800 Subject: [PATCH] Bugfix; `.respond_to` is no longer used in Rbs::Test::Errors#inspect_ --- lib/rbs/test/errors.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/rbs/test/errors.rb b/lib/rbs/test/errors.rb index b3c186d54..aa88a913f 100644 --- a/lib/rbs/test/errors.rb +++ b/lib/rbs/test/errors.rb @@ -29,8 +29,11 @@ def self.format_param(param) end end + RESPOND_TO = ::Kernel.instance_method :respond_to? + private_constant :RESPOND_TO + def self.inspect_(obj) - if obj.respond_to?(:inspect) + if RESPOND_TO.bind_call(obj, :inspect) obj.inspect else Test::INSPECT.bind(obj).call # For the case inspect is not defined (like BasicObject)