From a109599d5386fa405d97cf4c544996198a7da1b5 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Wed, 13 Nov 2024 22:23:04 +0900 Subject: [PATCH] vm.c (prepare_missing): add receiver's class in superclass calls --- src/vm.c | 2 +- test/t/kernel.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vm.c b/src/vm.c index 53d8f3329..40a8a8971 100644 --- a/src/vm.c +++ b/src/vm.c @@ -615,7 +615,7 @@ prepare_missing(mrb_state *mrb, mrb_callinfo *ci, mrb_value recv, mrb_sym mid, m if (mrb_func_basic_p(mrb, recv, missing, mrb_obj_missing)) { method_missing: - if (super) mrb_no_method_error(mrb, mid, args, "no superclass method '%n'", mid); + if (super) mrb_no_method_error(mrb, mid, args, "no superclass method '%n' for %T", mid, recv); else mrb_method_missing(mrb, mid, recv, args); /* not reached */ } diff --git a/test/t/kernel.rb b/test/t/kernel.rb index dd473fdb8..a48771536 100644 --- a/test/t/kernel.rb +++ b/test/t/kernel.rb @@ -346,7 +346,7 @@ assert('Kernel#method_missing', '15.3.1.3.30') do end end no_super_test = NoSuperMethodTestClass.new - msg = "no superclass method 'no_super_method_named_this'" + msg = "no superclass method 'no_super_method_named_this' for NoSuperMethodTestClass" assert_raise_with_message(NoMethodError, msg) do no_super_test.no_super_method_named_this end