1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Clarify the error message when trying to import C methods [Bug #18385]

This commit is contained in:
Shugo Maeda 2021-12-06 09:40:54 +09:00
parent e713552868
commit c2192cb985
No known key found for this signature in database
GPG key ID: 2DFE34085E97CE47

2
eval.c
View file

@ -1526,7 +1526,7 @@ refinement_import_methods_i(ID key, VALUE value, void *data)
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));