[前][次][番号順一覧][スレッド一覧]

ruby-changes:70074

From: Shugo <ko1@a...>
Date: Mon, 6 Dec 2021 09:43:24 +0900 (JST)
Subject: [ruby-changes:70074] c2192cb985 (master): Clarify the error message when trying to import C methods [Bug #18385]

https://git.ruby-lang.org/ruby.git/commit/?id=c2192cb985

From c2192cb985c10c90ba5e4d64652f79f89afff983 Mon Sep 17 00:00:00 2001
From: Shugo Maeda <shugo@r...>
Date: Mon, 6 Dec 2021 09:40:54 +0900
Subject: Clarify the error message when trying to import C methods [Bug
 #18385]

---
 eval.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eval.c b/eval.c
index 1cc699445fa..14241397105 100644
--- a/eval.c
+++ b/eval.c
@@ -1526,7 +1526,7 @@ refinement_import_methods_i(ID key, VALUE value, void *data) https://github.com/ruby/ruby/blob/trunk/eval.c#L1526
     struct refinement_import_methods_arg *arg = (struct refinement_import_methods_arg *)data;
 
     if (me->def->type != VM_METHOD_TYPE_ISEQ) {
-        rb_raise(rb_eArgError, "Can't import method: %"PRIsVALUE"#%"PRIsVALUE, rb_class_path(arg->module), rb_id2str(key));
+        rb_raise(rb_eArgError, "Can't import method which is not defined with Ruby code: %"PRIsVALUE"#%"PRIsVALUE, rb_class_path(arg->module), rb_id2str(key));
     }
     rb_cref_t *new_cref = rb_vm_cref_dup_without_refinements(me->def->body.iseq.cref);
     CREF_REFINEMENTS_SET(new_cref, CREF_REFINEMENTS(arg->cref));
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]